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

Use ExtendableMessageEvent for messageerror in service workers #25241

Closed
gterzian opened this issue Dec 11, 2019 · 14 comments
Closed

Use ExtendableMessageEvent for messageerror in service workers #25241

gterzian opened this issue Dec 11, 2019 · 14 comments

Comments

@gterzian
Copy link
Member

@gterzian gterzian commented Dec 11, 2019

In the light of w3c/ServiceWorker#1485

code:

MessageEvent::dispatch_error(target, scope.upcast());

Also requires adding a dispatch_error method to

impl ExtendableMessageEvent {

@nosark
Copy link
Contributor

@nosark nosark commented Jan 23, 2020

I'd like to work on this issue!

@gterzian
Copy link
Member Author

@gterzian gterzian commented Jan 24, 2020

Thanks @nosark, let me know if you have an questions.

@nosark
Copy link
Contributor

@nosark nosark commented Jan 27, 2020

@gterzian I want to clarify the necessary changes to be made. Am I adding the dispatch_error functionality to ExtendableMessageEvent and then replacing the MessageEvent::dispatch_error call in serviceworkerglobalscope.rs with the ExtendableMessageEvent::dispatch_error call? Do I need to create any new tests for the added dispatch_error function? Is there anything I'm missing? Thanks @gterzian !

@gterzian
Copy link
Member Author

@gterzian gterzian commented Jan 28, 2020

Yes that sounds like a correct description.

Regarding the tests, it looks like they were already added/changed in the WPT test suite by Chromium in https://chromium-review.googlesource.com/c/chromium/src/+/1921521 although it looks we haven't synced yet(which I believe will be done at some point semi-automatically). So I don't think you need to change anything. If your change makes a test fail, we will have to look into it, perhaps add a partial sync with the upstream test suite to your PR.

@jdm
Copy link
Member

@jdm jdm commented Jan 28, 2020

Those test changes were made last December, so we have definitely synced since then. That being said, we can't run most service worker tests because our implementation is very incomplete.

@nosark
Copy link
Contributor

@nosark nosark commented Jan 29, 2020

@gterzian @jdm Awesome, thank you for all of the info! Just a heads up, I was just assigned a concussion recovery protocol (hockey) so it may take me a little longer than usual, but I'll get this out asap!

@nosark
Copy link
Contributor

@nosark nosark commented Apr 23, 2020

Hey guys, I've started implementing this, but I am receiving a linking error similar to issue #20736 If I can't get around this, should I setup my windows machine and test and submit from that machine instead of my macbook?

@jdm
Copy link
Member

@jdm jdm commented Apr 23, 2020

Yes, it's important to be able to build when submitting code changes. Sorry we don't have any good suggestions for the linking error.

@nosark
Copy link
Contributor

@nosark nosark commented Apr 23, 2020

@jdm Awesome, thanks for the quick response, I'll get right on it!

@nosark
Copy link
Contributor

@nosark nosark commented May 20, 2020

@jdm Everything is building again on my mac, And I'm trying to test my solution. Is there a specific test I could run my solution against? I've tried running against the WPT test suite and most of the tests throw a navigator.serviceWorker.getRegistration() is not a function error. I imagine this error could be from the incomplete service worker tests implementation mentioned above. Thanks in advance!

@jdm
Copy link
Member

@jdm jdm commented May 21, 2020

Our service worker implementation is still incomplete, so I doubt there are any automated tests that run to the point where they can verify this change. @gterzian may know better than me, though.

@gterzian
Copy link
Member Author

@gterzian gterzian commented May 21, 2020

Yes so currently the SW globalscope actually doesn't run, so we can't test it with javascript and I think the change will not make a difference to the WPT test expectations, but I would say if it compiles it should be good enough for now. @nosark Do you want to open a PR with your work?

@nosark
Copy link
Contributor

@nosark nosark commented May 21, 2020

@jdm ok. @gterzian yeah I'll put in for PR. Thanks guys!

@kootoopas
Copy link

@kootoopas kootoopas commented May 30, 2020

Someone with access should add the "has open pr" label to this.

bors-servo added a commit that referenced this issue Jul 31, 2020
Use ExtendableMessageEvent for messageerror in service workers #25241

<!-- Please describe your changes on the following line: -->
added function dispatch_error to the ExtendableMessageEvent implmentation and replaced the MessageEvent dispatch error call with the ExtendableMessageEvent dispatch error call in serviceworkerglobalscope.rs

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #25241 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [x] These changes do not require tests because ___

<!-- 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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.