-
Notifications
You must be signed in to change notification settings - Fork 0
Stale song-change notifications #14
Comments
I think I've seen this other times without reloading the page. |
Clean up ugly code for managing song-change notifications. I'm not sure where the bug is, so I'm not sure if this will fix it.
I think that this still happens occasionally, but I'm not sure of the cause. It might be a Chrome OS bug where notifications aren't getting closed while the screen is locked. |
This still happens all the time. It's unrelated to screen-locking. I should investigate whether it happens when I foreground the tab while the notification is being shown. |
I'm seeing this happen even when the tab has been in the background the whole time. Current best theory: Sometimes notifications seem to take a while to show up (I have no idea why). Maybe the delay is sometimes longer than the 3-second timeout to close the notification. The code in this.notification_ = new Notification(
`${song.artist}\n${song.title}`,
options
);
this.closeNotificationTimeoutId_ = window.setTimeout(() => {
this.closeNotificationTimeoutId_ = null;
this.closeNotification_();
}, this.constructor.NOTIFICATION_SEC_ * 1000); |
Just saw a notification show up a full minute after a song had started playing (and then not get closed automatically). My best guess now is that Chrome is waiting for the notification's image to be downloaded before displaying anything. |
Old song-change notifications sometimes don't get cleared. One cause might be closing or reloading the page while the notification is displayed.
The text was updated successfully, but these errors were encountered: