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

Fix the issue where resource silently fails to load #9119

Merged
merged 3 commits into from
Aug 28, 2020
Merged

Conversation

baothientran
Copy link
Contributor

@baothientran baothientran commented Aug 28, 2020

Fixes #9093

When request.deferred.resolve(result) get called in the function RequestScheduler.getRequestReceivedFunction(), the callback can potentially create a new deferred object and assign it to the existing request. But after the resolve() above is executed, the request.deferred is assigned to undefined, which accidentally removes the newly created deferred object. So the second call of RequestScheduler.getRequestReceivedFunction() for the same request will lead to error of request.undefined.resolve(result).

For the fix, I save the old deferred object first, then modify the state of request, and call the resolve() at the end. The fix is similar to the cancel function just in case it can have the same potential problem

@lilleyse Can you please take a look at it? Please let me know if I should add anything

@baothientran baothientran requested a review from lilleyse August 28, 2020 01:55
@cesium-concierge
Copy link

Thanks for the pull request @baothientran!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@lilleyse
Copy link
Contributor

Nice catch @baothientran!

@lilleyse lilleyse merged commit 35a7eed into master Aug 28, 2020
@lilleyse lilleyse deleted the resources-fail branch August 28, 2020 18:32
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

Successfully merging this pull request may close these issues.

Resource silently fails to load if used multiple times.
3 participants