Skip to content

Drain TreeCRDT work before teardown - #107

Closed
marcus-pousette wants to merge 1 commit into
refactor/pr4325-review-cleanupfrom
refactor/pr4325-lifecycle-hardening
Closed

Drain TreeCRDT work before teardown#107
marcus-pousette wants to merge 1 commit into
refactor/pr4325-review-cleanupfrom
refactor/pr4325-lifecycle-hardening

Conversation

@marcus-pousette

@marcus-pousette marcus-pousette commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Stack

This is the focused teardown follow-up after #108, #109, and #106. Review and merge that stack first.

Summary

  • register persistence synchronously and bind it to the exact session ordered before the call
  • keep the real latest lifecycle promise separate from the failure-tolerant scheduling tail, so persistence receives init/drop failures instead of leaking into a later session
  • retain settled persistence failures until waitForIdle or teardown consumes them
  • stop ingress, drain captured persistence plus the shared write/materialization pipeline to a stable version, stop sync again, then release the client
  • verify failed-init ordering, drop → persist → init, idle waiting, error-safe draining, and failed cleanup ownership
  • strengthen the delayed-startup browser test by verifying the text entered before initialization is actually persisted

The shared write/materialization queues intentionally represent em’s one Redux integration pipeline; em creates one active app thoughtspace per browser realm. Client, provider session, persistence accounting, and WebSocket state remain factory-local.

Validation

  • the three runtime/teardown file patches match the previously validated version exactly by stable patch ID; the startup assertion was rebased onto Simplify window.em test access #109’s explicit preload type
  • yarn lint:tsc
  • all TreeCRDT unit suites — 10 files, 42 tests passed, including all 5 runtime lifecycle tests
  • focused post-restack runtime/lifecycle check — 20 tests passed
  • prior cumulative validation: full yarn lint, full unit suite, and Puppeteer startup plus treecrdt-single-tab passed

@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-review-cleanup branch from d928934 to 90dbbe4 Compare July 24, 2026 09:11
@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-lifecycle-hardening branch from b0d74c3 to 6a5aacf Compare July 24, 2026 09:31
@marcus-pousette marcus-pousette changed the title Harden TreeCRDT runtime lifecycle Drain TreeCRDT work before teardown Jul 24, 2026
@marcus-pousette
marcus-pousette marked this pull request as draft July 24, 2026 09:41
@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-review-cleanup branch from 90dbbe4 to f4721e0 Compare July 24, 2026 12:04
@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-lifecycle-hardening branch 2 times, most recently from 4e0621f to f198eba Compare July 24, 2026 12:11
@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-review-cleanup branch from f4721e0 to a88ff14 Compare July 24, 2026 12:11
@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-lifecycle-hardening branch from f198eba to 5e8c477 Compare August 4, 2026 13:20
@Antonov548
Antonov548 force-pushed the refactor/pr4325-review-cleanup branch from 3f195bb to 7dc894f Compare August 4, 2026 13:37
@marcus-pousette
marcus-pousette force-pushed the refactor/pr4325-lifecycle-hardening branch from 5e8c477 to 567c56c Compare August 4, 2026 13:50
@Antonov548 Antonov548 closed this Aug 19, 2026
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.

2 participants