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

Use new Thunderstore API to fetch community's package list #1345

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Conversation

anttimaki
Copy link
Collaborator

No description provided.

@@ -148,14 +161,61 @@ export const TsModsModule = {
},

actions: <ActionTree<State, RootState>>{
async _fetchPackageListIndex({}): Promise<string[]> {
// TODO: update GameManager to contain new API endpoint (or read from elsewhere?)
Copy link
Collaborator Author

@anttimaki anttimaki May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "hardcode endpoint URL for each game separately" still a valid strategy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new commit that just replaces the URLs in GameManager. If we want to do something fancier, like only pass a community-slug to the Game constructor and build the API URL internally from that, the changes can easily be thrown away with the commit.

@anttimaki
Copy link
Collaborator Author

@VilppeRiskidev you could also review this, even if only to know what's going on.

Thunderstore API uses blob files to serve immutable data, as this can
be efficiently cached via CDN. The blobs contain stringified JSON that
is compressed with gzip to save storage space.
Fetching Lethal Company's package list containing 30k+ mods in one
request has been pushing the limits for a while now. For users with
slower connections the request timeouts, and the ICP message size limit
is soon starting to cause problems.

To address these problems, the package list is now downloaded in
chunks. Each chunk is a separate blob file that can be heavily cached
on CDN level. Chunks are downloaded serially to support slower
connections. Caching to IndexedDB is done only when all chunks have
been downloaded so transaction can used to make the operation atomic.
@anttimaki anttimaki merged commit e28d874 into develop Oct 7, 2024
5 of 7 checks passed
@anttimaki anttimaki deleted the chunky branch October 7, 2024 11:42
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

Successfully merging this pull request may close these issues.

2 participants