-
Notifications
You must be signed in to change notification settings - Fork 822
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
adding bg-sync tag name check #1280
Conversation
@@ -94,6 +94,8 @@ class Queue { | |||
await this._runCallback('requestWillEnqueue', storableRequest); | |||
await this._queueStore.addEntry(storableRequest); | |||
await this._registerSync(); | |||
logger.log(`Request for '${request.url}' has been added to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please wrap this in an if statement for if (process.env.NODE_ENV !== 'production'){ ...log.... }
This allows rollup to remove the code in prod builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -168,7 +170,9 @@ class Queue { | |||
_addSyncListener() { | |||
if ('sync' in registration) { | |||
self.addEventListener('sync', (event) => { | |||
event.waitUntil(this.replayRequests()); | |||
if (event.tag === `${TAG_PREFIX}:${this._name}`) { | |||
event.waitUntil(this.replayRequests()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a log here to signal the sync event was received and replaying is being started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
PR-Bot Size PluginChanged File Sizes
New FilesNo new files have been added. All File SizesView Table
Workbox Aggregate Size Plugin☠️ WARNING ☠️We are using 154% of our max size budget. Total Size: 22.52KB Gzipped: 9.01KB |
R: @jeffposnick @addyosmani @gauntface
Adds a check for tag name before replaying the requests in background sync queue.