Fix recurring events blocked by unique source_ref - #3669
Merged
Merged
Conversation
events:generate-recurring wrote every child as source_ref=parent:{id}.
That column is unique, so after the first occurrence every later night
failed with a duplicate-key error (~15 parents/day on live).
Use parent:{id}:{Y-m-d} instead, and rewrite any legacy bare parent:{id}
row so further occurrences can be created.
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Problem
Live logs ~15
Recurring generation errorlines every night:events:generate-recurringstores every child assource_ref = parent:{id}. That column has a unique index (used by partner imports). After the first child is written, every later occurrence collides.95 approved recurring series are still eligible; 678 already have a single legacy child and cannot advance.
Fix
parent:{id}:{Y-m-d}.parent:{id}row to the dated form so the unique index frees up.Tests
tests/Feature/GenerateRecurringEventsTest.php— three cases, all pass:Deploy note
Safe to ship before October: it stops nightly error noise and unblocks series that have been stuck since their first child. Dry-run first on live if preferred:
Made with Cursor