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

a new version is available notification keeps showing up #211

Open
smeijer opened this issue Jun 23, 2020 · 6 comments
Open

a new version is available notification keeps showing up #211

smeijer opened this issue Jun 23, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@smeijer
Copy link
Member

smeijer commented Jun 23, 2020

Bug Report 🐛

The 'refresh for update' indicator is a bit buggy

refresh-indicator

To Reproduce ✔️

  1. No idea, maybe it's only the netlify preview build?

Expected behavior 🤔

The refresh indicator should only appear once, and be gone when I click "refresh".

Suggested solution 🔦

Your Environment 💻

  • browser: Chrome
  • os: Linux
@smeijer smeijer added the bug Something isn't working label Jun 23, 2020
@JacobMGEvans
Copy link
Contributor

JacobMGEvans commented Jun 24, 2020

Oh, interesting! I wonder if I can recreate that.

Edit: I got it to happen once with setting the if blocks to true but now I need to figure out how to clear the worker lmao
Edit2: figured out the service worker stuff, back to recreating and fixing the bug 😅
Edit3: So with the serviceWorker conditionals set to true I am able to render the Toast but I am oddly getting 3
Screen Shot 2020-06-23 at 9 40 04 PM

@JacobMGEvans
Copy link
Contributor

JacobMGEvans commented Jun 28, 2020

It seems like the service worker Registration onstatechange() is being called multiple times which is where the toast component lives.
Screen Shot 2020-06-28 at 3 52 46 PM

@smeijer
Copy link
Member Author

smeijer commented Jun 28, 2020

Thanks for the research 👍

I would expect installingWorker.state === 'installed' to handle that. Did you find any useful difference between the events, that we can use to detect the right one?

If not, we can always set and check a file scope notified flag.

@JacobMGEvans
Copy link
Contributor

That handled it but there was an additional condition checking the ServiceWorker controller that was null for the first 2 state changes and never seemed to render the toast unless I removed it. Currently, I am trying to see if I can find onstatechange( behavior for installed that will also do it but not have the other renders will null states

@smeijer
Copy link
Member Author

smeijer commented Jul 8, 2020

@JacobMGEvans, were you able to find a solution for this issue? I consider disabling the notification entirely. Because it's really bugging me.

@ljosberinn
Copy link
Contributor

Reminder for myself to check this out tomorrow 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants