903 B
903 B
Incremental Data Caching
Objective
Enable caching of card data to the server incrementally per set when multiple sets are selected, rather than sending a single massive payload at the end. avoiding PayloadTooLargeError.
Implementation Details
- Helper Function: Created
cacheCardsToServerhelper withinfetchAndParseto handle server communication for a chunk of cards. - Incremental Loop: Modified the set fetching loop to call
cacheCardsToServerimmediately after receiving data for each set. - UI Feedback: Updated progress text to clearly indicate when the system is "Caching [Set Name]..." to the server.
- Error Handling: Added try/catch within the caching helper to prevent a single cache failure from aborting the entire fetch process (logs error to console).
Status
Completed. Large multi-set fetches should now be robust against body size limits.