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

Return the highest priority error from the descendant instead of return the very first one #25552

Merged
merged 1 commit into from Jan 20, 2020

Conversation

@CYBAI
Copy link
Collaborator

CYBAI commented Jan 19, 2020

The test failed because we didn't return the highest priority error (which is network error in this case).

As Manish mentioned in #25436 (comment), that's because we're using the Promise.all trick to signal loads.

If we can avoid relying on Promise.all, maybe we don't need to do a complex logic like this; instead, ideally, we should always finish the module load immediately when we hit network failure so that we don't even need to do the max() comparison.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #25436
  • There are tests for these changes
@highfive
Copy link

highfive commented Jan 19, 2020

Heads up! This PR modifies the following files:

@CYBAI
Copy link
Collaborator Author

CYBAI commented Jan 19, 2020

@highfive highfive assigned Manishearth and unassigned paulrouget Jan 19, 2020
@CYBAI
Copy link
Collaborator Author

CYBAI commented Jan 19, 2020

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jan 19, 2020

Trying commit cd04f74 with merge ac735ff...

bors-servo added a commit that referenced this pull request Jan 19, 2020
Return the highest priority error from the descendant instead of return the very first one

The test failed because we didn't return the highest priority error (which is network error in this case).

As Manish mentioned in #25436 (comment), that's because we're using the Promise.all trick to signal loads.

If we can avoid relying on Promise.all, maybe we don't need to do a complex logic like this; instead, ideally, we should always finish the module load immediately when we hit network failure so that we don't even need to do the `max()` comparison.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25436
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 19, 2020

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator Author

CYBAI commented Jan 19, 2020

The failure is #25522

Copy link
Member

jdm left a comment

Looks sensible!

components/script/script_module.rs Outdated Show resolved Hide resolved
components/script/script_module.rs Outdated Show resolved Hide resolved
…rn the very first one
@CYBAI CYBAI force-pushed the CYBAI:fix-25436 branch from cd04f74 to 33988cd Jan 20, 2020
@jdm
Copy link
Member

jdm commented Jan 20, 2020

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Jan 20, 2020

📌 Commit 33988cd has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jan 20, 2020

Testing commit 33988cd with merge 3772775...

bors-servo added a commit that referenced this pull request Jan 20, 2020
Return the highest priority error from the descendant instead of return the very first one

The test failed because we didn't return the highest priority error (which is network error in this case).

As Manish mentioned in #25436 (comment), that's because we're using the Promise.all trick to signal loads.

If we can avoid relying on Promise.all, maybe we don't need to do a complex logic like this; instead, ideally, we should always finish the module load immediately when we hit network failure so that we don't even need to do the `max()` comparison.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25436
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 20, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jan 20, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Jan 20, 2020

Testing commit 33988cd with merge 0b79fe3...

bors-servo added a commit that referenced this pull request Jan 20, 2020
Return the highest priority error from the descendant instead of return the very first one

The test failed because we didn't return the highest priority error (which is network error in this case).

As Manish mentioned in #25436 (comment), that's because we're using the Promise.all trick to signal loads.

If we can avoid relying on Promise.all, maybe we don't need to do a complex logic like this; instead, ideally, we should always finish the module load immediately when we hit network failure so that we don't even need to do the `max()` comparison.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25436
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 20, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 0b79fe3 to master...

@bors-servo bors-servo merged commit 33988cd into servo:master Jan 20, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@CYBAI CYBAI deleted the CYBAI:fix-25436 branch Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.