Skip to content

WarpDrive: transactional notification delivery and reactive request state - #1232

Draft
runspired wants to merge 2 commits into
emberjs:mainfrom
runspired:runspired-warp-drive-notification-buffering
Draft

WarpDrive: transactional notification delivery and reactive request state#1232
runspired wants to merge 2 commits into
emberjs:mainfrom
runspired:runspired-warp-drive-notification-buffering

Conversation

@runspired

@runspired runspired commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Propose WarpDrive: transactional notification delivery and reactive request state

Rendered

Summary

This pull request is proposing a new RFC.

To succeed, it will need to pass into the Exploring Stage, followed by the Accepted Stage.

A Proposed or Exploring RFC may also move to the Closed Stage if it is withdrawn by the author or if it is rejected by the Ember team. This requires an "FCP to Close" period.

An FCP is required before merging this PR to advance to Accepted.

Upon merging this PR, automation will open a draft PR for this RFC to move to the Ready for Released Stage.

Exploring Stage Description

This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.

An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an Exploring label applied.

An Exploring RFC that is successfully completed can move to Accepted with an FCP is required as in the existing process. It may also be moved to Closed with an FCP.

Accepted Stage Description

To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.

If there are unanswered questions, we have outlined them and expect that they will be answered before Ready for Release.

When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the Ready for Release stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.

Checklist to move to Exploring

  • The team believes the concepts described in the RFC should be pursued.
  • The label S-Proposed is removed from the PR and the label S-Exploring is added.
  • The Ember team is willing to work on the proposal to get it to Accepted

Checklist to move to Accepted

  • This PR has had the Final Comment Period label has been added to start the FCP
  • The RFC is announced in #news-and-announcements in the Ember Discord.
  • The RFC has complete prose, is well-specified and ready for implementation.
    • All sections of the RFC are filled out.
    • Any unanswered questions are outlined and expected to be answered before Ready for Release.
    • "How we teach this?" is sufficiently filled out.
  • The RFC has a champion within one of the relevant teams.
  • The RFC has consensus after the FCP period.

…equest state

Proposes replacing WarpDrive's five notification flush timing policies
with a single invariant -- all store-managed writes happen inside a
transaction and publish in one synchronous batch at its close -- and
rebuilding RequestStateService as transactionally-written, signals-backed
data. Leaves the public reactive-request-subscription API shape, the
perf-sensitive internal transaction shape, and coordination with the
Render Aware Scheduler interface (emberjs#957) as unresolved
questions for the Exploring stage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CMTUUPwpZXGjqCM8nUDrP
@runspired runspired self-assigned this Sep 2, 2026
@runspired runspired added T-ember-data RFCs that impact the ember-data library S-Proposed In the Proposed Stage labels Sep 2, 2026
Post-open template housekeeping now that the Proposal PR is open at
emberjs#1232.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CMTUUPwpZXGjqCM8nUDrP
@runspired runspired changed the title Add RFC: WarpDrive transactional notification delivery and reactive request state WarpDrive: transactional notification delivery and reactive request state Sep 2, 2026
consistent now" point.

These are all partial answers to one question — *when is the current unit of
work done?* — using three incompatible definitions of "unit of work."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

a note on this we should record: this complexity grew out of a forced requirement that emberjs is in the process of removing via #957

because ember historically would render synchronously, and because it hijacked RSVP's promise flush to schedule a render - one if not many renders could occur in the middle of a microtask queue flush interleaved with WarpDrive's work to handle a request response.

While interleaving will not stop being an issue, the move to transactions makes observing state at any moment in time safer, while Ember's move away from rendering in-the-middle-of-thing will remove the risk application's often experienced in this area. A primary focus of the existing flush configuration is buffering notify until the finally of the last microtask used to yield the request response back to the consumer - thereby attempting to avoid any application re-renders occurring prior to the requesting call-site itself having had the opportunity to process the result. With ember moving away from the dangerous semantics it had, this will no longer be a threat and we can simplify our internals and the maintenance burden.

This rises to the level of RFC instead of an internal design choice for 3 reasons:

  1. the timing of this change needs to be somewhat coordinated with landing the new scheduler and fixing Ember's flush.
  2. the RequestStateService which we have always planned to revisit to produce a simpler API currently does not participate in our coordinated notifications system and will need to
  3. these timing changes for flush are user observable, and historically changes to them - even when to make it more correct or safer - have resulted in test failures in consuming apps where tests had become reliant on a specific interleaving of render and microtask ordering.

mutate → coalesce → sync → notify → cleanup
```

- `mutate` is the transaction body; `coalesce` and `sync` are the graph's

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

WarpDrive's existing _run and _join implementation are intentionally optimized for low memory overhead and high execution speed. Storing callbacks is inherently risky for perf - we will have to analyze the tradeoff. This may call for a linked list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(note that despite the similarity in method names and purpose, WarpDrive's internal run/join/schedule/flush mechanism today is not intended to be a microtask polyfill like backburner was. It is not possible to have safe transactions in async code: this is purely a work ordering mechanism to enable a safe sync progression through work to be completed)

store.push(payloadB);
record.name = 'Chris';
}); // one publication
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we're missing a deeper store teardown/unloadAll handling explanation here. Today these situations are highly optimized to intentionally sever notifications, remove subscribers, and teardown associated state as quickly as possible in an order the prevents additional work being triggered or the internals from churning/recreating objects. We will still want those optimizations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-Proposed In the Proposed Stage T-ember-data RFCs that impact the ember-data library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants