Skip to content

a new version is available notification keeps showing up #211

Open

Description

@smeijer

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

Activity

  1. JacobMGEvans commented on Jun 24, 2020

    @JacobMGEvans
    Contributor

    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

  2. JacobMGEvans commented on Jun 28, 2020

    @JacobMGEvans
    Contributor

    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

  3. smeijer commented on Jun 28, 2020

    @smeijer
    MemberAuthor

    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.

  4. JacobMGEvans commented on Jun 28, 2020

    @JacobMGEvans
    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

  5. smeijer commented on Jul 8, 2020

    @smeijer
    MemberAuthor

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

  6. ljosberinn commented on Jul 24, 2020

    @ljosberinn
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions