fix(sync,web): clear remaining event-color optimistic risks - #2749
Merged
cursor[bot] merged 3 commits intoAug 10, 2026
Conversation
Drop provider colorHex when a Compass slot color is applied or a prior slot is cleared so settle/refetch cannot resurrect the old hex fill. Clear Google eventLabelId when writing a slot colorId. Defer draft discard on drag/resize/nudge replace until onOptimisticApplied. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
…ked replace Google only accepts eventLabelId clears under eventLabelVersion=1, which ignores colorId — clear the label first, then write the slot colorId. Return whether replace started and tear down covering drafts when it does not, so blocked or no-op updates cannot leave a stuck draft. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.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.
Summary
Follow-up to #2744 /
v1.1.181. Clears the two remaining optimistic color risks without reworking the shipped draft/onOptimisticAppliedcolor path.Risk 1 —
colorHexrehydrates after settlemergeUpdateContent: slot writes drop providercolorHex; clearing a prior slot does too. Hex-only events that receive draftcolor: nullkeepcolorHex(avoids wiping labels on unrelated edits/drags).eventLabelIdundereventLabelVersion=1, then writecolorIdat default v0 (Google ignorescolorIdunder v1).useSetEventColor: picking the same slot still writes when a lingeringcolorHexis winning the palette.Risk 2 — drag/resize early draft discard
Reuse existing
onOptimisticAppliedplumbing so covering drafts stay up until the optimistic cache write lands:useDraftActionsUPDATE submituseUpdateEventcallbacksreplacereturns whether the mutation started; blocked/no-op paths still tear down covering draftsSimplification
Kept discard teardown on the existing
onOptimisticAppliedcallback (including blocked paths) instead of adding a second callback. Google label clear is a dedicated preconditioned patch rather than overloadinggoogleColorIdFields.Validation
bun test:sync:fast/ focused Google writer + merge testsbun test:webfocused:useUpdateEvent,useSetEventColor,useEventMutations, Day interactionbun run type-check,bun run lintIndependent review
Addressed: two-step Google label clear; discard when replace/update never mutates. Residual: intentional hex-only +
color: nullstill preservescolorHexby design to avoid draft null wiping labels.