Closed obedm503 closed 2 weeks ago
At the moment I'm not limiting the sync operations as I wasn't sure if we might need them later. Of course, we could delete all done operations and keep only the last one, but what about error cases? Should we also keep only the last error, maybe a few more or even all of them? Right now I'm thinking about a parameter that allows setting a retention of sync operations. What do you think about this solution?
For now, let's just cleanup the sync operations
The
SyncManager
's internalsyncOperations
collection never shrinks. This could be an issue for people using local storage persistence because of its small storage limit but still applies to all adapters.I have an app with 5 collections using the
SyncManager
and an indexed db persisted.This is what the initial storage state looks like after it loads: Everything is good so far: 5 snapshots, 5 sync operations, no changes, and no remote changes.
Here is what it looks like after editing each type of entity:
Notice how
sync-operations
grew significantly.Snapshots also grew but it never got past twice the number of collections. I assume this has something to do with how the
pull
method interacts with remote changes. Not a big deal.This is what it looks like after editing all each type of entity on a different client to make this one receive remote changes:
Snapshots returned to it's initial size but sync operations kept growing.