fix: stop retrying legacy page-view migration on every page load - #118
Merged
Conversation
alexs-mparticle
force-pushed
the
fix/page-view-migration-retry
branch
3 times, most recently
from
August 18, 2026 19:08
e6bda79 to
13744df
Compare
When the migration write fails, the legacy key was retained "for retry", causing PAGE_VIEW_CAPTURE_FAILED to fire on every subsequent page load for affected users. Fix by using writeNamespacedFieldWithinBudget (which evicts oldest records before giving up) and always removing the legacy key so the retry loop can't fire again.
alexs-mparticle
force-pushed
the
fix/page-view-migration-retry
branch
from
August 18, 2026 19:22
13744df to
ccd95a5
Compare
jaissica12
approved these changes
Aug 18, 2026
crisryantan
approved these changes
Aug 18, 2026
alexs-mparticle
added a commit
that referenced
this pull request
Aug 18, 2026
When the migration write fails, the legacy key was retained "for retry", causing PAGE_VIEW_CAPTURE_FAILED to fire on every subsequent page load for affected users. Fix by using writeNamespacedFieldWithinBudget (which evicts oldest records before giving up) and always removing the legacy key so the retry loop can't fire again.
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 18, 2026
## [1.33.4](v1.33.3...v1.33.4) (2026-08-18) ### Bug Fixes * stop retrying legacy page-view migration on every page load ([#118](#118)) ([c4772f8](c4772f8))
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
migrateLegacyPageViewStoragewas retaining the legacympPageViewskey on write failure and returning early, causingPAGE_VIEW_CAPTURE_FAILEDto fire on every subsequent page load for affected userswriteNamespacedField(bare write, no eviction) towriteNamespacedFieldWithinBudgetso oversized legacy payloads are trimmed before the write is attemptedreturnon failure soremoveKey(LEGACY_PAGE_VIEWS_KEY)always executes — ending the retry loop regardless of outcomeEvidence
Datadog shows Belk (
kitv_1.33.0) generating ~330/dayPAGE_VIEW_CAPTURE_FAILEDerrors, with 101 hits carrying the exact message"retaining legacy key for retry"— third most common message across all Belk errors in the past 7 days.Test plan
nullafter a failed migration (wasnot.toBeNull())PAGE_VIEW_CAPTURE_FAILED(no retry)ERR_REQUIRE_ESMunrelated to this change🤖 Generated with Claude Code