Skip to content

Master CI: lifecycle tests assume synchronous writes from microtask-batched stores #112

Description

@ctoth

Problem

Current master at 0ce34aedc9729c7ac006d79b34e86fae3fb0ec0a is red: Node.js CI run 31566084951 fails two tests while 1,081 pass.

The failures reproduce locally in both the full suite and a focused single-fork run:

  • src/client.test.ts:412 — disconnected-command output is still pending when the test reads the store.
  • src/createConfiguredClient.test.ts:323 — channel/output history is still pending when the lifecycle test reads the stores.

Root cause

PR #108 intentionally changed outputStore and channelHistoryStore appends to flush in a microtask. PR #91 was based on older master (3ff3dfa) and merged later; its new lifecycle tests assert those stores synchronously. Each PR was green against its own base, but their merge result violates the new store contract.

This is an integration regression, not evidence that either the batching or owner-reset architecture should be rolled back.

Acceptance criteria

  • Update the two lifecycle tests to observe the public post-flush state instead of reading immediately after enqueue.
  • Add an integration regression proving an entry enqueued immediately before close() is eventually preserved in user history/output.
  • Preserve the existing reset() contract that deliberately discards pending entries for stores that are reset.
  • Do not add a synchronous compatibility shim or undo microtask batching.
  • npm test is green in full, not only for the two focused files.
  • npm run typecheck passes.

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