Skip to content

Remove the stack timezone: time values carry their own meaning #473

Closed

Description

@cuibonobo

Problem

Every adapter read ownerEntityId and timezone from _config once, at open(), and cached them. ownerEntityId is immutable, so its cache can't go stale. timezone can be patched (stack.patchContent('_config', { timezone })), and after that adapter.timezone and stack.timezone keep returning the old value until the store is reopened.

Dropping the cached property and reading timezone from _config fixes the staleness, but it exposes a deeper issue. The only thing that depends on a stack timezone is commons event's allDay rule ("calendar dates … interpreted in the stack's configured timezone"). _config is owner-only, so once discovery stops carrying timezone, a non-owner viewing a shared all-day event can't interpret it. Making _config readable would be a permission an owner can revoke, or a new special rule, and either way the stack timezone would still be the wrong place for this fact.

Proposal

A time value carries what it means, and a date's form says which of three things it is:

  • A date-time with a Z or offset is a moment: the same instant everywhere. Apps show it in the viewer's timezone; "3 hours ago" needs only the current time.
  • YYYY-MM-DD is a calendar day: the same date for every reader.
  • A date-time with no offset is a wall-clock reading (9am in Lisbon). It names no instant until paired with a zone, so a Type that stores one declares a zone field beside it.

Changes:

  • Remove timezone from ConfigContent, the _config@1 schema and every open() option. _config holds only { ownerEntityId }.
  • Remove timezone from StackRecordAdapter and its implementations (MemoryAdapter, the shared SQLite adapter, adapter-local, combineAdapters, APIAdapter), and drop stack.timezone. Remove StackIdentity, which becomes the same shape as ConfigContent; newStoreSeed() takes ConfigContent.
  • Remove timezone from the discovery response (DiscoveryResponse, fixtures, wire-format.md § Discovery). This is a wire change.
  • Commons event: drop allDay. startsAt's form says whether the event is timed or all-day, and endsAt is the first moment or day after the event, in either form (as iCalendar's DTEND).
  • Spec: state the rule in data-model.md § Types, and update spec.md § The _config record, adapters.md, portability.md, wire-format.md.

ownerEntityId stays cached: it's immutable, and core uses it for permission checks.

Changeset: minor for core, wire-types, conformance-fixtures, adapter-api, adapter-local, record-adapter-sqlite and record-adapter-do-sqlite.

Follows from #470.

Activity

  1. changed the title [-]Drop the cached timezone: read it from _config like any Record[/-] [+]Remove the stack timezone: time values carry their own meaning[/+] on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions