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

Investigate AbortController() pre-emptively stopping requests #128

Open
MichaelSwigerAtBentley opened this issue Nov 18, 2024 · 6 comments
Assignees

Comments

@MichaelSwigerAtBentley
Copy link

MichaelSwigerAtBentley commented Nov 18, 2024

In Desktop View Test in iTwin/viewer when attempting to get imodels for a given iTwin, the api call is stalling and being aborted:

Image

This causes the iModels page to never load, leaving 3 loading animations cycling forever, as described in this Issue

Removing the
signal: abortController.signal
from useIModelData.ts#L127 corrects the issue.

Removing React.StrictMode from the app also corrects the issue.

We should investigate why this is interfering with the request.

Additional info:
Running the request with the same accessToken and headers does return the iModels as normal, ruling out a clientId or auth issue.

@MichaelSwigerAtBentley
Copy link
Author

MichaelSwigerAtBentley commented Nov 18, 2024

@aruniverse - @hl662 and I were able to reproduce the user's issue, and it seems related to the abortController as mentioned above.

@aruniverse
Copy link
Member

is this an issue with react 18 strict mode?

@MichaelSwigerAtBentley
Copy link
Author

MichaelSwigerAtBentley commented Nov 18, 2024

is this an issue with react 18 strict mode?

Yes, that did it. Removing the strict mode corrects the issue. Should I remove it from the desktop-viewer-test?

@aruniverse
Copy link
Member

is this an issue with react 18 strict mode?

Yes, that did it. Removing the strict mode corrects the issue. Should I remove it from the desktop-test-app?

Remove it from the template and suggest that as a fix to the user

@MichaelSwigerAtBentley
Copy link
Author

Closing this issue with PR: iTwin/viewer#339

@aruniverse
Copy link
Member

Re-opening, as there still is an issue with this custom hook in react 18 strict mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants