Badge is not updating in a timely way
Fryguy opened this issue · 16 comments
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?
I'm also having the same issue:
https://www.bestpractices.dev/projects/8358
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:
- 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.
- 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.
BTW, congrats on earning the badge!
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.