fix(scratchnode): tolerate lastActivityAt drift so Convex deploy passes#477
Merged
Conversation
…nvex deploy passes Production Convex deploy for #476 failed with: ✖ Schema validation failed. Document in table "liveEvents" contains extra field `lastActivityAt` that is not in the validator. Root cause: a parallel agent (Codex live-metrics) deployed a schema variant to the SAME prod deployment earlier that stamped `lastActivityAt` onto liveEvents rows. When #476 added its indexes, Convex re-validated all rows and rejected the drifted demo-event document. Neither main nor Codex's current branch declares the field, and no code writes it — it's orphaned drift. Fix: declare `lastActivityAt: v.optional(v.number())` so the validator accepts the existing prod data (forward-compatible, no data migration). This unblocks `npx convex deploy`, which in turn deploys the synthesis indexes (by_startedAt / by_status_startedAt / by_lastSeen) that events:getLandingStats needs for the live "active now" counter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact ( |
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.
Why
The Convex Deploy for #476 (the landing synthesis) failed, which is why the synthesis isn't live yet:
A parallel agent (Codex live-metrics) deployed a schema variant to the same prod deployment earlier that stamped
lastActivityAtontoliveEventsrows. When #476 added its indexes, Convex re-validated every row and rejected the drifted demo-event document. Neithermainnor Codex's current branch declares the field, and no code writes it — orphaned drift.Fix
Declare
lastActivityAt: v.optional(v.number())so the validator accepts the existing prod data (forward-compatible, no data migration). This unblocksnpx convex deploy, which then ships the synthesis indexes (by_startedAt/by_status_startedAt/by_lastSeen) thatevents:getLandingStatsneeds for the live "active now" counter — and the merge re-triggers the stuck Vercel frontend deploy.One-line change. 🤖 Generated with Claude Code