fix: retry page-view storage writes on quota failure and log eviction - #126
Merged
Merged
Conversation
When localStorage is full, evict the oldest page-view records one by one and retry until the write succeeds or no records remain. Preserves the most-recent data under quota pressure instead of discarding the entire write.
…under quota pressure Emits a Datadog-visible log when writePageViews succeeds after evicting records, making quota-pressure eviction visible without requiring a full storage failure. Allows measuring the effectiveness of the eviction retry.
alexs-mparticle
force-pushed
the
fix/page-view-quota-eviction
branch
from
August 19, 2026 19:41
0032ff2 to
3ca27d7
Compare
alexs-mparticle
force-pushed
the
fix/page-view-quota-observability
branch
from
August 19, 2026 19:41
ebc1a3d to
3d1149f
Compare
6 tasks
alexs-mparticle
changed the base branch from
fix/page-view-quota-eviction
to
development
August 19, 2026 20:11
crisryantan
approved these changes
Aug 20, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 20, 2026
## [1.34.1](v1.34.0...v1.34.1) (2026-08-20) ### Bug Fixes * retry page-view storage writes on quota failure and log eviction ([#126](#126)) ([2e88327](2e88327))
Collaborator
|
🎉 This PR is included in version 1.34.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
writePageViewshits a localStorage quota error, evict the oldest record and retry — continuing until the write succeeds or no records remain. Returns the number of records stored (0 on total failure) so the caller can distinguish eviction from failure.PAGE_VIEW_QUOTA_EVICTIONincapturePageViewwhen a write succeeds after eviction, making quota-pressure visible in Datadog without requiring a full storage failure.Why
~385
PAGE_VIEW_CAPTURE_FAILED [reason: quota]errors/day. The browser's total origin localStorage is full, so writes fail even with the 25-record cap. Evicting to fewer records recovers writes when there is some space, just not enough for all 25. Without the eviction log, a successful recovery is invisible — only total failures surface in Datadog.Datadog query after this ships:
Test plan
writePageViewsreturns stored count: 1 record, 25-record cap, single eviction, multi-eviction, pre-seeded storage with eviction, total failure🤖 Generated with Claude Code