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

Badge is not updating in a timely way #2072

Open
Fryguy opened this issue Oct 23, 2023 · 6 comments
Open

Badge is not updating in a timely way #2072

Fryguy opened this issue Oct 23, 2023 · 6 comments

Comments

@Fryguy
Copy link

Fryguy commented Oct 23, 2023

I recently achieved 100% for my project, but the badge continues to say 99%. I've tried clearing cache and cookies, so I think it's something server side? Perhaps it's run on a schedule?

BadgeApp

Also see https://www.bestpractices.dev/en/projects/4282

@Fryguy
Copy link
Author

Fryguy commented Oct 23, 2023

Gah, I just noticed #2070, so might be a duplicate of that one.

@justinmclean
Copy link

I'm also having the same issue:
https://www.bestpractices.dev/projects/8358

@david-a-wheeler
Copy link
Collaborator

david-a-wheeler commented Mar 13, 2024

Drat. We made a number of changes that should have completely eliminated this problem. I notice that https://www.bestpractices.dev/en/projects/4282 is at 100%, including its listing in /projects, so it eventually updates, but it takes its time. Too much time.

We specifically tell our CDN (Fastly) to throw away the badge image. My best current hypothesis is that there's a race between where we tell the CDN to drop it and the retrieval of the image. We update the data before we tell the CDN to drop it, and take various steps to make sure it works 100% when tested locally. However, on the deployed system, if the two actions are not handled in the order we supply, then this could be the result. That would explain a number of problems.

If this hypothesis is correct, then I think there are two things we can do:

  1. In the /projects list, if the change was made recently, force a specific image to be shown. We already do this on the specific badge entries, for the same reason.
  2. After a badge level change, resend a "throw away the cache of this image" request after a period of time. That way, if the CDN receives the commands out-of-order, it'll eventually clear the cache and get the correct answer this time.

Other ideas welcome.

@david-a-wheeler david-a-wheeler changed the title Badge is not updating Badge is not updating in a timely way Mar 13, 2024
@david-a-wheeler
Copy link
Collaborator

BTW, congrats on earning the badge!

@david-a-wheeler
Copy link
Collaborator

We've made changes (as I said), but I've left this issue open because it's notoriously hard to be sure that you fixed a race condition - it's not a bug that reliably reproduces.

@Fryguy
Copy link
Author

Fryguy commented Mar 13, 2024

I'm fine with closing this one, especially if #2070 is the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants