Skip to content

fix(huddle): unify lifecycle reconstruction#2128

Open
Areson wants to merge 6 commits into
block:mainfrom
Areson:Areson/huddle-indicator-state
Open

fix(huddle): unify lifecycle reconstruction#2128
Areson wants to merge 6 commits into
block:mainfrom
Areson:Areson/huddle-indicator-state

Conversation

@Areson

@Areson Areson commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Why

The channel header could keep showing a phantom active huddle after everyone left, while the timeline card correctly showed the same huddle as ended.

What

  • Share one lifecycle reducer between the header indicator and timeline attachment
  • Fold relay-signed JOIN/LEFT transitions independently from client-signed START timestamps
  • End huddles on explicit end or a fully drained participant set when the lifecycle replay is complete
  • Keep empty truncated history inconclusive even when clock skew leaves START inside the 100-event window
  • Apply the 60-minute stale-start fallback only to an unconfirmed START with no participant activity, and exempt the locally current huddle
  • Select the newest retained session before applying terminal state so an older incomplete huddle cannot reappear after a newer huddle ends
  • Add focused coverage for skewed JOIN/LEFT, drained and truncated skew cases, staleness, current-huddle state, and non-resurrection

Risk Assessment

Low to medium — scoped to desktop huddle lifecycle reconstruction and display state. Explicit END remains authoritative; inferred drain now requires a complete replay, while clock-skewed participant activity remains live.

References

  • just ci
  • Focused lifecycle regression suite: 14/14 passing
  • Full desktop unit suite: 3,194/3,194 passing
  • Browser mock: fresh huddle showed Join active huddle (1 participant); final LEFT restored Start huddle with no phantom count

Generated with Codex

Areson and others added 6 commits July 19, 2026 10:24
Share huddle lifecycle semantics between the channel card and header indicator so stale or drained huddles cannot retain a phantom participant.

Co-authored-by: Ian Oberst <ioberst@squareup.com>
Signed-off-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Treat empty participant state as conclusive only when START remains in the subscription window. Keep long-running and locally current huddles active when newer lifecycle evidence supersedes the start-age fallback.

Co-authored-by: Ian Oberst <ioberst@squareup.com>
Signed-off-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Fold relay participant transitions independently from client START timestamps, preserve uncertainty for truncated history, and stop the header from falling back to older sessions after a newer huddle ends.

Co-authored-by: Ian Oberst <ioberst@squareup.com>
Signed-off-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Co-authored-by: Ian Oberst <ioberst@squareup.com>
Signed-off-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Co-authored-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Signed-off-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Ian Oberst <ioberst@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
Signed-off-by: Ian Oberst <ioberst@squareup.com>
@Areson
Areson marked this pull request as ready for review July 19, 2026 23:51
@Areson
Areson requested a review from a team as a code owner July 19, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant