P1: timed Journal Undo changes the original time zone #913

Open
opened 2026-10-02 17:39:51 +00:00 by kayg · 0 comments
Owner

P1: timed Journal Undo changes the original time zone

Independent read-only review for #777. Reviewed job/datafix at
4345529d6. The defect exists in the base and remains in the changed
inverse. No runtime test ran in this LIGHT review.

Evidence

  • apps/web/src/routes/calendar/[view]/[date]/+page.svelte:835 retains date,
    start, and end, but not the Log's zone. The inverse at line 851 sends
    tz: timezone().
  • apps/web/src/routes/calendar/[view]/[date]/+page.svelte:878 starts the
    field inverse. Lines 878–883 do not retain the zone. Line 901 sends the
    current User zone for any timed inverse.
  • apps/web/src/lib/calendar/journal.ts:26 excludes zone from retained
    fields, although the timed forward patch replaces tz.
  • crates/plugins/notes/src/lib.rs:4423 applies the tz patch to
    event.entry.zone.

Failure sequence

  1. A Log records 09:00–10:00 in Europe/Berlin on 2026-09-24.
  2. The User views Calendar with zone UTC and resizes the Log.
  3. Undo has the correct forward ETag. It restores 09:00–10:00 with tz: UTC.
  4. The original start was 07:00Z. The restored start is 09:00Z.

A floating Log also becomes zoned. A concurrent zone-only edit can pass
the new retained-field check because it compares wall times without zone.
This is a wrong accepted inverse, not a stale ETag failure.

Expected and concrete fix

DESIGN §30 C12 requires the Log's recorded capture zone. Undo must restore
the complete time value. Retain the original zone, including null. Use the
existing tz patch field to restore it. Check the retained zone when the
forward write replaces it. Do not change the Undo revision to a later read.

Regression test idea

Use source zone Europe/Berlin and User zone UTC. Resize and Undo through
the Calendar. Check the original zone, wall times, and absolute instant in
the Daily note and CalDAV output. Repeat for move, Composer time edits,
floating Logs, and a zone-only edit from another Installation. The last
case must conflict before overwriting its zone.

Duplicate searches used timezone and Calendar timezone Undo in all
states. No issue title covers this wrong inverse.

# P1: timed Journal Undo changes the original time zone Independent read-only review for #777. Reviewed `job/datafix` at `4345529d6`. The defect exists in the base and remains in the changed inverse. No runtime test ran in this LIGHT review. ## Evidence - `apps/web/src/routes/calendar/[view]/[date]/+page.svelte:835` retains date, start, and end, but not the Log's zone. The inverse at line 851 sends `tz: timezone()`. - `apps/web/src/routes/calendar/[view]/[date]/+page.svelte:878` starts the field inverse. Lines 878–883 do not retain the zone. Line 901 sends the current User zone for any timed inverse. - `apps/web/src/lib/calendar/journal.ts:26` excludes `zone` from retained fields, although the timed forward patch replaces `tz`. - `crates/plugins/notes/src/lib.rs:4423` applies the `tz` patch to `event.entry.zone`. ## Failure sequence 1. A Log records 09:00–10:00 in Europe/Berlin on 2026-09-24. 2. The User views Calendar with zone UTC and resizes the Log. 3. Undo has the correct forward ETag. It restores 09:00–10:00 with `tz: UTC`. 4. The original start was 07:00Z. The restored start is 09:00Z. A floating Log also becomes zoned. A concurrent zone-only edit can pass the new retained-field check because it compares wall times without zone. This is a wrong accepted inverse, not a stale ETag failure. ## Expected and concrete fix DESIGN §30 C12 requires the Log's recorded capture zone. Undo must restore the complete time value. Retain the original zone, including null. Use the existing `tz` patch field to restore it. Check the retained zone when the forward write replaces it. Do not change the Undo revision to a later read. ## Regression test idea Use source zone Europe/Berlin and User zone UTC. Resize and Undo through the Calendar. Check the original zone, wall times, and absolute instant in the Daily note and CalDAV output. Repeat for move, Composer time edits, floating Logs, and a zone-only edit from another Installation. The last case must conflict before overwriting its zone. Duplicate searches used `timezone` and `Calendar timezone Undo` in all states. No issue title covers this wrong inverse.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#913
No description provided.