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

API delivering outdated information. #2070

Open
jkowalleck opened this issue Oct 18, 2023 · 3 comments
Open

API delivering outdated information. #2070

jkowalleck opened this issue Oct 18, 2023 · 3 comments

Comments

@jkowalleck
Copy link

jkowalleck commented Oct 18, 2023

Under certain circumstances (described here),
https://www.bestpractices.dev/projects/7953/badge.json / https://bestpractices.coreinfrastructure.org/projects/7953/badge.json
delivers outdated (cached?) information.

Expected response:

{"id":7953,"name":"CycloneDX PHP ComposerPlugin","updated_at":"2023-10-18T00:12:11.928Z","badge_level":"passing","tiered_percentage":125}

But for some client, the observed response always is:

{"id":7953,"name":"cyclonedx/cyclonedx-php-composer","updated_at":"2023-10-15T14:15:00.046Z","badge_level":"in_progress","tiered_percentage":24}

see badges/shields#9660 (comment) for more details and analysis.

@jkowalleck
Copy link
Author

jkowalleck commented Oct 20, 2023

*Update: 2023-10-20

New issue: also the badge you provide yourself shows a 99% while it shows a "100%" in the top bar
ossf_bp7953_2023-10-20_10-44-13

@andrewfader
Copy link
Collaborator

probably related to our production caching

@david-a-wheeler
Copy link
Collaborator

This is very very strange. I thought we'd fixed this.

My best hypothesis is that this is a race condition in the communication between our site and our CDN (Fastly). We update our data and send a "remove from cache" message. However, if the CDN requests a data retrieval, executes a remove from cache, and then receives the data with old data, it would put old data into the cache. I don't see anything in the APIs that can fully prevent this, if that's what is going on.

If that's the problem, then maybe we need to re-send "remove from cache" messages later, to reduce the time where it can occur. That's basically harmless ("do no harm").

Other ideas welcome.

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