Skip to content

Unify the event skipping algorithm when there is no event handler. #1417

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

Merged
merged 4 commits into from
Jun 6, 2019

Conversation

mfalken
Copy link
Member

@mfalken mfalken commented Jun 5, 2019

This makes {install,activate,fetch,message} events and
functional events use the same algorithm to determine
whether to skip firing the event, and makes it a may
rather than must.

It also unifies the concept of a stale registration to reduce
duplicated text.

Addresses #1200


Preview | Diff

mfalken added 2 commits June 5, 2019 10:48
This makes fetch events, functional events, and message events use
the same algorithm to determine whether to skip firing the event,
and makes it a *may* rather than *must*.

It also unifies the concept of a stale registration to reduce
duplicated text.
@mfalken mfalken requested a review from jakearchibald June 5, 2019 02:12
Copy link
Contributor

@jakearchibald jakearchibald left a comment

Choose a reason for hiding this comment

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

This is great. Much less copy & paste going on. Just one question:

docs/index.bs Outdated
@@ -2926,7 +2934,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
The |task| *must* use |activeWorker|'s [=event loop=] and the [=handle functional event task source=].

1. Wait for |task| to have executed or been discarded.
1. If the time difference in seconds calculated by the current time minus |registration|'s [=last update check time=] is greater than 86400, invoke [=Soft Update=] algorithm with |registration|.
1. If |registration| is [=stale=], then run the [=Soft Update=] algorithm with |registration|.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also be in parallel?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. I noticed this too and thought I'd just keep the existing behavior, but yea it looks right to do it in parallel. I'm also wondering if there's a point to "Wait for |task| to have executed..." but will leave it for now.

@mfalken
Copy link
Member Author

mfalken commented Jun 6, 2019

Thanks, also propagated changes to v1.

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

Successfully merging this pull request may close these issues.

2 participants