-
Notifications
You must be signed in to change notification settings - Fork 189
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
Conversation
src/store/modules/TsModsModule.ts
Outdated
@@ -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?) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@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.
No description provided.