Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Do not put a rejected promise into sourceMapRequests cache #537

Merged
merged 3 commits into from
Jul 31, 2017

Conversation

tromey
Copy link
Contributor

@tromey tromey commented Jul 31, 2017

My previous patch in this area was mistaken - it correctly allowed
errors from _fetchSourceMap to be propagated to the caller, but it
also cached the rejected promise in sourceMapRequests, resulting in
the same error being reported via other APIs. This patch fixes the
oversight by caching a non-rejecting promise; this results in the
other APIs keeping their previous behavior.

My previous patch in this area was mistaken - it correctly allowed
errors from _fetchSourceMap to be propagated to the caller, but it
also cached the rejected promise in sourceMapRequests, resulting in
the same error being reported via other APIs.  This patch fixes the
oversight by caching a non-rejecting promise; this results in the
other APIs keeping their previous behavior.
@tromey tromey requested a review from jasonLaster July 31, 2017 19:20
Copy link
Contributor

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Is there a test that demonstrates the fix?

@tromey
Copy link
Contributor Author

tromey commented Jul 31, 2017

Is there a test that demonstrates the fix?

There's one in M-C already. I'll see if I can write a local one though.

@tromey tromey merged commit 422a361 into firefox-devtools:master Jul 31, 2017
@tromey tromey deleted the do-not-cache-rejection branch July 31, 2017 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants