fix(web,core): rebase remote promote-all onto series master delta - #2751
Merged
Conversation
Signed-in promote/scope-all replaces were forwarding an occurrence's absolute schedule as the series DTSTART. Share the local delta helper in core and apply it before remote replace when a cached series master exists. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Use dayjs day-unit diffs for all-day rebases and collapse repeated promote/assert scaffolding in the mutations tests. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
…races Snapshot the series master schedule before optimistic writes, and skip IndexedDB fallback for rebased occurrence scope-all replaces so the delta cannot be applied twice. 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
Signed-in recurrence promote (
scope: "all"after a middle-occurrence SHIFT+ARROW nudge) was forwarding the occurrence’s absolute schedule as the series master DTSTART. Local IndexedDB already rebases viashiftSeriesScheduleByOccurrenceEdit; remote did not.shiftSeriesScheduleByOccurrenceEditinto@core; localreplaceSeriesimports itscope === "all"RemoteEventRepositoryskips IndexedDB fallback for occurrence + scope-all (avoids double-applying the delta)thisAndFollowingkeeps absolute remainder DTSTART; local source unchangedSimplicity
Collapsed all-day delta math onto
dayjs.diff(..., "day")and shared promote/assert test helpers. LeftresolveRemoteReplaceScheduleas a named helper — it documents the remote vs local ownership split.Automated validation
"all"middle timed + all-day → repository schedule is master+deltathisAndFollowingkeeps absolute schedulereplaceSeries/ nudge→promote suite greenIndependent review
Fresh read-only review found three medium issues; all fixed in follow-up commits:
onMutateTest plan
bun run test:core -- packages/core/src/util/event/shift-series-schedule-by-occurrence-edit.test.tsbun run test:web -- packages/web/src/events/mutations/useEventMutations.test.tsx packages/web/src/events/repositories/local.event.repository.test.ts packages/web/src/events/repositories/remote.event.repository.test.tsbun run type-checkbun run lint