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

Resolve Job Promise can resolve jobs with an incorrect value #829

Closed
mkruisselbrink opened this issue Feb 5, 2016 · 5 comments
Closed

Comments

@mkruisselbrink
Copy link
Collaborator

Currently the Resolve Job Promise algorithm resolves all equivalent jobs with the same value, I don't think this is correct. For example multiple equivalent register jobs should possibly be resolved with distinct ServiceWorkerRegistration instances (if they were called from different javascript contexts). But maybe more importantly, two equivalent jobs can have different client properties; this means that for example with a register job each equivalent promise needs a ServiceWorkerRegistration instance with a different associated service worker client.

@wanderview
Copy link
Member

Where does ServiceWorkerRegistration have an associated client? I don't see that in the spec.

@mkruisselbrink
Copy link
Collaborator Author

Where does ServiceWorkerRegistration have an associated client? I don't see that in the spec.

https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#dfn-service-worker-registration-interface-client

@wanderview
Copy link
Member

Oh, I see. I'm probably missing something, but it seems thats not really needed. The .installing/waiting/active getters could get the service worker client from the current context's service worker client.

@mkruisselbrink
Copy link
Collaborator Author

I'm not even sure what ServiceWorker needs an associated service worker client for. It's postMessage method doesn't even use the associated client but looks it up from the incumbent settings object instead, and I can't see anywhere else it is used either. So yes, removing the associated client from ServiceWorker and ServiceWorkerRegistration is probably the sanest solution, unless we're both missing something.

@jungkees
Copy link
Collaborator

F2F: I'll inspect and fix it.

jungkees added a commit that referenced this issue Jan 12, 2017
This changes Resolve Job Promise algorithm to use a right value for
equivalent job promises by specifying the value should be the one for
its relevant Realm.

Fixes #829.
jungkees added a commit that referenced this issue Jun 26, 2017
This changes Resolve Job Promise/Reject Job Promise algorithms and their
call sites to use correct fulfillment values/rejection reasons for
equivalent job promises by specifying the associated realms.

Fixes #829.
jungkees added a commit that referenced this issue Jun 30, 2017
This changes Resolve Job Promise/Reject Job Promise algorithms and their
call sites to use correct fulfillment values/rejection reasons for
equivalent job promises by specifying the associated realms.

Fixes #829.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants