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

fix: Add maxQueuedEventCount parameter to trim events in storage if over a limit #222

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

crleona
Copy link
Collaborator

@crleona crleona commented Sep 3, 2024

Summary

Adds a configuration parameter, maxQueuedEventCount, intended to control the maximum number of events we store on device. Set to a negative value to have no max count.

Every time we initialize Amplitude, we check maxQueuedEventCount. If set to a value greater than zero, we will delete all but the most recent maxQueuedEventCount events. Note that we will never attempt to split or otherwise rewrite a block during this process, so we may store an actual max event count of maxQueuedEventCount + flushQueueSize - 1. We also never will clear storage during the lifetime of the Amplitude instance, so more than maxQueuedEventCount events may be queued on the device until the next time Amplitude is run.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@crleona crleona requested review from izaaz and a team September 3, 2024 23:59
@crleona crleona merged commit 0134383 into main Sep 5, 2024
8 checks passed
@crleona crleona deleted the AMP-107637-add-storage-truncation branch September 5, 2024 20:32
github-actions bot pushed a commit that referenced this pull request Sep 5, 2024
## [1.9.1](v1.9.0...v1.9.1) (2024-09-05)

### Bug Fixes

* Add maxQueuedEventCount parameter to trim events in storage if over a limit ([#222](#222)) ([0134383](0134383))
* Send a max of one upload at a time ([#221](#221)) ([63e76d9](63e76d9))
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