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

Consider adding a real-time package updates endpoint instead of the cached /api/packages #8430

Open
AlexV525 opened this issue Dec 20, 2024 · 5 comments

Comments

@AlexV525
Copy link

I uploaded candid_dart_core at 10:37 PM, but the package shows up at 10:58 PM in the endpoint. The endpoint is the source where we determine which packages need an update in our flutter-io.cn CDN.

@isoos
Copy link
Collaborator

isoos commented Jan 3, 2025

@AlexV525: /api/packages is a cached endpoint (10 minutes), but it is also using our name-tracker component that periodically checks the package entries (every 15 minutes). Your reported lag seems to be a combination of those two. (Moreover it is an unofficial endpoint we may want to stop supporting in the future, as it combines more aspects into one endpoint, making it hard to cache/invalidate).

I think in the past few months we have discussed a new endpoint that only returns the package names that got a new version published or some metadata updated in the past hour/day/week. Would that be enough for your use case?

@AlexV525
Copy link
Author

AlexV525 commented Jan 3, 2025

I think in the past few months we have discussed a new endpoint that only returns the package names that got a new version published or some metadata updated in the past hour/day/week. Would that be enough for your use case?

That sounds covered our cases. AFAIK we use the name of the packages and handle the rest instead of depending on the provided information. FYI @chenglu

@chenglu
Copy link

chenglu commented Jan 3, 2025

May I know more about the name-tracker component/api? We need to update the package updates / CDN purge code accordingly.

@isoos
Copy link
Collaborator

isoos commented Jan 3, 2025

May I know more about the name-tracker component/api?

This is an internal component, not really exposed, but used in other parts of the app. I wouldn't build on the current functionality of it.

We need to update the package updates / CDN purge code accordingly.

I think a new API endpoint is the way to go here.

@chenglu
Copy link

chenglu commented Jan 3, 2025

I LOVE this idea if the team can public this as an API endpoint, so that we could do the cache to the CN mirrors smartly!

@AlexV525 AlexV525 changed the title /api/packages seems quite late to show a recently uploaded package Consider adding a real-time package updates endpoint instead of the cached /api/packages Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants