Skip to content

social test: face-rooms pins local-time titles to UTC strings, so the file is red on every non-UTC machine #3106

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: b8416b79222d43199c9183fce882b342
Branch: dev/1-face-when-local-tz
Base: 5cb1692
At: 2026-11-15T08:38:28Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Bot: FlyBot Dev-1

What goes wrong

plugins/social/test/face-rooms.test.js pins a local-time render to fixed UTC strings. faceRoomTitle formats through core/src/shared/face-title.js formatFaceWhen, which reads the host's local zone (date.getHours(), getMinutes(), getMonth(), getDate()), so the same instant renders differently per zone — and only TZ=UTC produces the strings the test expects:

TZ 2026-10-17T14:38:00.000Z
UTC Oct 17 14:38 (asserted)
Asia/Shanghai Oct 17 22:38
Europe/Berlin Oct 17 16:38
America/New_York Oct 17 10:38

Two assertions on live main 5cb16923 therefore go red on any machine that is not in UTC — for a rendering that is correct:

  • :250 const at = '2026-10-17T14:38:00.000Z' → :254 expects Face-to-face · UiA1415, UiB1415 · Oct 17 14:38.
  • #194 case at :644: :646/:647 expiresAt: '2026-10-17T13:06:00.000Z' with :649 expecting /12:56$/, and :650/:651 createdAt: '2026-10-17T12:40:00.000Z'.

Red first, base 5cb16923, plugins/social → node --import ./test/resolve.mjs --test test/face-rooms.test.js (38 tests, 36 pass / 2 fail in both zones):

TZ=Asia/Shanghai
not ok 9 - owner-typed face-room lines encode as a human envelope
    + 'Face-to-face · UiA1415, UiB1415 · Oct 17 22:38'
    - 'Face-to-face · UiA1415, UiB1415 · Oct 17 14:38'
not ok 28 - #194: a face room title shows one time, the creation time, before and after Enter chat
    The input did not match the regular expression /12:56$/. Input:
    'Face-to-face · Alice · Oct 17 20:56'

TZ=America/New_York  → same two, actual `… · Oct 17 10:38` and `'Face-to-face · Alice · Oct 17 08:56'`

Different offsets, same class of failure: the expectation is tied to the host zone, not to an offset bug.

Expected

The tests keep asserting exactly what they assert today — the title carries the room's local creation time, and two rooms with the same owners stay distinguishable — but pass in every zone:

  • build the fixture instants from local components (new Date(2026, 9, 17, 14, 38).toISOString()), so Oct 17 14:38 and /12:56$/ hold everywhere; or
  • assert against formatFaceWhen(at) computed in the same process.

Expectations stay exact: no tolerance window, no regex that accepts any hour, no skip/todo, and the neighbouring assertions (:253 titleA === titleB, :255-262, :257-260 two different starts must still differ) unchanged. The test must not become vacuous.

Scope

  • Test only: plugins/social/test/face-rooms.test.js (+ its byte-identical mirror if this file keeps one).
  • No product change: core/src/shared/face-title.js / plugins/social/src/face-rooms.js keep formatting in local time.
  • T1 (test-only diff), no user-visible behaviour change. plugins/social/test/** maps to docs/subsystems/social.md; test-only, so the commit carries a Docs-not-needed: trailer rather than a doc edit.

Acceptance

  1. Red on the base in a non-UTC zone (above, two zones, same class).
  2. Green after the change in TZ=UTC, TZ=Asia/Shanghai, TZ=Europe/Berlin, twice each, 38/38 every run.
  3. Whole social package green in a non-UTC zone (TZ=Asia/Shanghai npm --prefix plugins/social test, 701/701), and npm run verify exit 0.
  4. No third hard-coded local render left in the same file.

Out of scope (checked, not changed)

plugins/social/test/social.test.js:4076/:4086 carries the same literal but is not red: shownFaceTitle reuses the timestamp stored in room.name (storedWhen → faceStamp) instead of re-deriving local time — 492/492 under TZ=Asia/Shanghai.

Dedupe (2026-11-15, live main 5cb16923)

Activity

  1. HugoXK commented on Nov 15, 2026

    @HugoXK
    ContributorAuthor

    Heartbeat

    Written-by: FlyBot Lead
    Still-working: b8416b79222d43199c9183fce882b342
    At: 2026-11-15T08:45:56Z

  2. added a commit that references this issue on Nov 15, 2026
    3773d25
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