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

The Enable Auto Updates banner can momentarily flash on page load. #8235

Closed
1 task
techanvil opened this issue Feb 8, 2024 · 10 comments
Closed
1 task

The Enable Auto Updates banner can momentarily flash on page load. #8235

techanvil opened this issue Feb 8, 2024 · 10 comments
Labels
P1 Medium priority Type: Bug Something isn't working

Comments

@techanvil
Copy link
Collaborator

techanvil commented Feb 8, 2024

Bug Description

The Enable Auto Updates banner can momentarily flash on page load. See video below.

Note that this might be a glitch that only occurs for a local development environment, and needs some further investigation.

Steps to reproduce

This was reproducible following these steps. However, it only occurred on my local development environment, I tried on a TasteWP site and the Enable Auto Updates banner stayed visible. Therefore, it would be useful to check if this occurs for other developers and whether it points to an issue that is exclusive to the local environment, or a wider issue.

  1. Site up Site Kit and connect Analytics.
  2. Disconnect Analytics.
  3. See the Enable Auto Updates banner momentarily flash on loading the desktop.

Update: As per @jimmymadon's comment below this is reproducible, at least on a local development environment. Note Jimmy's additional requirement to reproduce this: deleting the auto_update_plugins field from the database.

Screenshots

auto-updates-banner-flash.mp4

Additional Context

  • PHP Version: any
  • OS: any
  • Browser: any
  • Plugin Version: any
  • Device: Spotted on 1.119.0

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The Enable Auto Updates banner should not momentarily flash on page load.

Implementation Brief

  • Update this condition in EnableAutoUpdateBannerNotification to check for isDismissed !== false, ensuring that the widget will render null while isDismissed is still loading (i.e. while it's undefined).

Test Coverage

  • Update any failing tests.

QA Brief

This task is a bit hard to test as the issue is caused by a race condition and only happens if the API endpoints load super fast, which is only the case on local.

Changelog entry

  • Fix bug that could cause the "Enable automatic updates" banner to appear then disappear briefly when the user has a slow internet connection.
@techanvil techanvil added P1 Medium priority Type: Bug Something isn't working labels Feb 8, 2024
@jimmymadon
Copy link
Collaborator

@techanvil Yes, this happens on my local dev environment as well - the banner appears for a while and then disappears. In addition to your Steps to reproduce, I did have to delete the auto_update_plugins field from my database too (to clear the previously saved value for Site Kit).

@techanvil
Copy link
Collaborator Author

Cool, thanks for checking this @jimmymadon! With this being reproducible, I've updated the issue with AC and moved it to IB.

@jimmymadon
Copy link
Collaborator

On some further investigation, the banner randomly decided to stay put. To reproduce, I reset site kit again and redid the Steps to reproduce but now, I had to refresh the page in quick succession.

Screen.Recording.2024-02-08.at.17.57.59.mov

@hussain-t hussain-t self-assigned this Feb 10, 2024
@ivonac4 ivonac4 added the Next Up Issues to prioritize for definition label Feb 16, 2024
@hussain-t hussain-t removed their assignment Feb 18, 2024
@zutigrm zutigrm self-assigned this Feb 26, 2024
@zutigrm
Copy link
Collaborator

zutigrm commented Feb 28, 2024

Unassigning myself, in order not to hold it, as I didn't get a chance to explore it yet, and in favour of another P0 issue with higher priority so I can move that one faster

@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Feb 28, 2024
@zutigrm
Copy link
Collaborator

zutigrm commented Feb 29, 2024

@techanvil I cannot reproduce this, I even tried on the slow 3g network. Banner is stable and fixated on my end all the time:

image

Are you still being able to reproduce this?

@techanvil
Copy link
Collaborator Author

techanvil commented Feb 29, 2024

Hi @zutigrm, I just gave it a try and am still able to reproduce it on my local dev environment. Tested and reproduced in Chrome on both Mac and Linux. It happens less often on the Mac for some reason.

@techanvil techanvil removed their assignment Feb 29, 2024
@zutigrm
Copy link
Collaborator

zutigrm commented Feb 29, 2024

I am unassigning myself so someone else who can reproduce it can debug it. I can't replicate it on my end

@zutigrm zutigrm removed their assignment Feb 29, 2024
@techanvil techanvil assigned techanvil and unassigned techanvil Mar 11, 2024
@aaemnnosttv
Copy link
Collaborator

IB ✅

@ivonac4 ivonac4 removed the Next Up Issues to prioritize for definition label Mar 13, 2024
@derweili derweili self-assigned this Mar 14, 2024
@derweili derweili removed their assignment Mar 15, 2024
@derweili
Copy link
Collaborator

This issue is caused by a race condition.
This happens only if the isDismissed is still loading while hasUpdatePluginCapacity, hasChangePluginAutoUpdatesCapacity and siteKitAutoUpdatesEnabled are resolved.

@hussain-t hussain-t assigned hussain-t and unassigned hussain-t Mar 15, 2024
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt Mar 18, 2024
@mohitwp mohitwp self-assigned this Mar 19, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Mar 20, 2024

QA Update ✅

  • Tested on dev and main environment.
  • I'm able to reproduce issue on latest environment.
  • Verified on dev and main environment flicker issue is now not reproducible.

Latest -

Recording.829.mp4

Dev -

Recording.828.mp4

</details.

@mohitwp mohitwp removed their assignment Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants