mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-18 16:13:51 -06:00
Three separate defects all showed up as "I saved a schedule and it moved". 1. expandSchedule emitted two different wire formats. A one-off returned start_time untouched - a naive wall-clock string, which the browser parses in its own zone - while a recurring instance returned cursor.toISOString(), an absolute instant derived by reading that same string in the SERVER's zone. The browser converted it back and the two conversions do not cancel: an operator in Tokyo saving Wednesday 20:00 got Thursday 10:00 from a US-Central server. Only recurring schedules were affected, which is why it looked intermittent. The calendar was also the odd one out. services/scheduler.js compares start_time as a string and never builds a Date from it, so expandSchedule was the only place in the codebase treating a wall-clock time as an instant - the drawing disagreed with playback as well as with the browser. 2. Saving an edit moved the schedule to today. The save handler rebuilds start_time from `pendingCreateDate || new Date()`, and editSchedule() restored only HH:MM - it never recorded the date being edited. Changing a colour on a block dated 5 Aug rewrote it to this week. No timezone mismatch required; this one hit everybody and silently altered stored data. 3. A cancelled drag-create leaked its date into the next schedule. pendingCreateDate was cleared only on a successful save, and the modal's two dismissers are inline onclick="...display='none'" attributes that cannot reach that scope. The date is now assigned by every path that OPENS the modal, so no dismissal path can leave a stale value behind. Tests assert the property rather than a literal: that the wire value is wall-clock and that the day survives a server/browser zone mismatch in BOTH directions. A literal-string assertion would pass just as happily with the bug present on a differently-configured CI box. Both new files fail on the parent commit and pass here; the schedule, calendar and timezone suites are green at 85 tests. Claude-Session: https://claude.ai/code/session_014kfhrUPit5MCqxeTQyqr56 Co-authored-by: Dan Walters <dan.walters@bytetinker.net> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| activity.js | ||
| admin.js | ||
| agency.js | ||
| ai.js | ||
| assignments.js | ||
| auth.js | ||
| billing.js | ||
| contact.js | ||
| content.js | ||
| device-groups.js | ||
| devices.js | ||
| folders.js | ||
| kiosk.js | ||
| layouts.js | ||
| media.js | ||
| org-sso.js | ||
| pip.js | ||
| player-debug.js | ||
| playlists.js | ||
| provisioning.js | ||
| reports.js | ||
| schedules.js | ||
| status.js | ||
| stripe.js | ||
| subscription.js | ||
| teams.js | ||
| telemetry-collector.js | ||
| tokens.js | ||
| video-walls.js | ||
| white-label.js | ||
| widgets.js | ||
| workspaces.js | ||