Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse ExtendableMessageEvent for messageerror in service workers #25241
Comments
|
I'd like to work on this issue! |
|
Thanks @nosark, let me know if you have an questions. |
|
@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 ! |
|
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. |
|
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. |
|
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? |
|
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. |
|
@jdm Awesome, thanks for the quick response, I'll get right on it! |
|
@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! |
|
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. |
|
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? |
|
Someone with access should add the "has open pr" label to this. |
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. -->
In the light of w3c/ServiceWorker#1485
code:
servo/components/script/dom/serviceworkerglobalscope.rs
Line 418 in b98a8fc
Also requires adding a
dispatch_errormethod toservo/components/script/dom/extendablemessageevent.rs
Line 85 in b98a8fc