Skip to content

Replace a re-sent livestream revision instead of rendering it twice - #5969

Merged
Eugene (OEvgeny) merged 8 commits into
mainfrom
OEvgeny/fix-livestream-resent-revision
Oct 29, 2026
Merged

Eugene (OEvgeny) merged 8 commits into
mainfrom
OEvgeny/fix-livestream-resent-revision

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

A livestream revision received again with the same ID (e.g. after a reconnect) is added to its session a second time; development builds throw "graph has N activities, Redux has N+1 activities".

Changelog Entry

Fixed

  • Fixed livestream revisions re-sent with the same ID shown twice, in PR #5969, by @OEvgeny

Description

upsert() inserted a re-sent livestream revision into its session without removing its previous entry, so sortedActivities listed it twice. A known activity now skips the streaming fast path, and the slow path replaces its previous session entry.

Design

  • The fast path stays insert-only: a re-sent revision is rare, so it falls back to the slow path (an O(1) activityMap check) instead of teaching the fast path to splice out the old entry.

Specific Changes

  • sort/upsert.ts: skip the fast path for known activities; remove a revision's previous entry before inserting it into its session
  • upsert.livestream.spec.ts, upsert.howToWithLivestream.spec.ts: a re-sent revision stays once in the session and in sortedActivities (fast and slow path)
  • livestream/resentRevision.html (+ .entity): snapshot 1, one message with the third revision; the store and activity key list each revision once
  • I have added tests and executed them locally
  • I have added .changelog/<PR#>-<slug>.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov added 7 commits October 22, 2026 16:23
An update with the same ID that leaves, joins, or moves between HowTo groupings
stayed in its previous grouping and was inserted again, so it was rendered twice.
A revision received again with the same ID (e.g. after a reconnect) was
inserted into its livestream session a second time, so it appeared twice in
the sorted activities (and the development build threw "Activities from graph
and Redux are of different size"). The fast path now skips known activities,
and the slow path removes the previous entry before inserting.
…m-resent-revision

# Conflicts:
#	packages/core/src/reducers/activities/sort/upsert.howToWithLivestream.spec.ts
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 28, 2026 23:57
Copilot AI balanced review requested due to automatic review settings October 28, 2026 23:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Comment thread packages/core/src/reducers/activities/sort/upsert.ts
@OEvgeny
Eugene (OEvgeny) enabled auto-merge (squash) October 29, 2026 00:25
@OEvgeny
Eugene (OEvgeny) merged commit 9b2e7b7 into main Oct 29, 2026
34 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/fix-livestream-resent-revision branch October 29, 2026 00:50
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.

3 participants