Skip to content

fix(mobile): complete compaction admission and batch lifecycle - #722

Merged
huichen merged 1 commit into
mainfrom
fix/mobile-compaction-lifecycle
Sep 18, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/mobile-compaction-lifecycle

Conversation

@huichen

@huichen huichen commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes remaining after #721

  • Wire immediate, conversation-scoped local pending state into the real composer (spinner, blocked button/keyboard sends, hidden repeat action). Preserve editable drafts; also guard retry/continue while the local request is pending. ACK alone does not unlock Send.
  • Cancel waits on conversation/peer/bridge changes and unmount; ignore late ACKs/outcomes rather than clearing another conversation’s pending request or showing its error toast. Validate accepted=true in ACKs.
  • Standalone compaction uses operation/checkpoint identities directly in the reducer, including the production batch and cooperative replay paths. It no longer uses a singleton accumulator with a run-scoped sequence. Preserve old replies, multi-run chronology, automatic inline compaction, and history/checkpoint deduplication.
  • Scope terminal matching to session+operation; retain bounded early results. Cancel/reset cleans up timers and listeners. Only explicit idle state reads begun after registration can end an unobserved result; projected flags cannot. Bounded serial read-only probes recover even when both started and terminal frames are lost, without retrying the mutation.

Verification

  • Final mobile tsc, ESLint and complete Jest suite: 115 suites / 1691 tests passed. Includes real hook+composer submission tests, single/batch/replay comparison, SyncEngine live batch delivery, early/late responses, session changes, cancellation, missed frames and timer cleanup.
  • Negative control: temporarily restored the two runtime files from fix(mobile): keep standalone compaction out of the reply stream #721, keeping the new regression tests. All four selected checks failed (missing pending, missing batch/replay divider); restored this fix and all four passed.
  • Real RN Web harness with mock host: delayed ACK/no-started scenario asserts immediate spinner, blocked Send after ACK, retained draft and recovered Send/checkpoint after completion. Existing committed and unchanged scenarios also passed in separate browser profiles. The mock now uses the actual batch reducer, not a single-event substitute.
  • Harness still logs the pre-existing MarkdownImage web onLoad source.width exception; no overlay obscures the composer and all explicit compaction assertions pass. Not a native-device/live-Agent E2E.

No running service was restarted and no user conversation was mutated.

@huichen
huichen enabled auto-merge (squash) September 18, 2026 06:03
@huichen
huichen merged commit a5a0d37 into main Sep 18, 2026
12 checks passed
@huichen
huichen deleted the fix/mobile-compaction-lifecycle branch September 18, 2026 06:05
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