Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findPlacesNearPoint does not use abort signal #1199

Open
mpayson opened this issue Mar 8, 2025 · 2 comments
Open

findPlacesNearPoint does not use abort signal #1199

mpayson opened this issue Mar 8, 2025 · 2 comments
Assignees
Labels
Milestone

Comments

@mpayson
Copy link
Contributor

mpayson commented Mar 8, 2025

Describe the bug

findPlacesNearPoint does not use the abort signal that is passed to it

Reproduction

The following code snippet logs the response, rather than an abort error

import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { findPlacesNearPoint } from "@esri/arcgis-rest-places";

const apiKey = "<replace me>";

const abortController = new AbortController();
findPlacesNearPoint({
  x: -73.735152,
  y: 40.9384275,
  radius: 1600 * 5, // 5 miles in meters
  categoryIds: ["4d4b7105d754a06372d81259"], // Schools
  authentication: ApiKeyManager.fromKey(apiKey),
  signal: abortController.signal,
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.error(error);
  });

abortController.abort();

Logs

System Info

"@esri/arcgis-rest-places": "1.2.0"

Additional Information

No response

@patrickarlt
Copy link
Contributor

@gavinr it looks like signal, credentials, hideToken and suppressWarnings are all missing from https://github.com/Esri/arcgis-rest-js/blob/main/packages/arcgis-rest-request/src/utils/append-custom-params.ts#L14 which is why they aren't getting passed thorough down to request internally.

Since this could have a lot of long reaching implications do we want to hold this until REST JS v5 when we refactor options anyway?

@gavinr-maps gavinr-maps modified the milestone: v4.0 Mar 10, 2025
@gavinr-maps
Copy link
Contributor

@patrickarlt sounds reasonable to me. I've created a new milestone to start tracking v5 items: https://github.com/Esri/arcgis-rest-js/milestone/3

@gavinr-maps gavinr-maps added this to the v5 milestone Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants