feat: implement incremental card caching to the server per set to prevent payload size limits.

This commit is contained in:
2025-12-16 23:37:11 +01:00
parent 552eba5ba7
commit 2efb66cfc4
4 changed files with 43 additions and 21 deletions

View File

@@ -0,0 +1,13 @@
# 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
1. **Helper Function**: Created `cacheCardsToServer` helper within `fetchAndParse` to handle server communication for a chunk of cards.
2. **Incremental Loop**: Modified the set fetching loop to call `cacheCardsToServer` immediately after receiving data for each set.
3. **UI Feedback**: Updated progress text to clearly indicate when the system is "Caching [Set Name]..." to the server.
4. **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.