Skip to content

React Web: .reactively() returns { response, aborted } - #208

Open
rileysdev wants to merge 3 commits into
mainfrom
riley/reactive-reader-unification-web
Open

rileysdev wants to merge 3 commits into
mainfrom
riley/reactive-reader-unification-web

Conversation

@rileysdev

@rileysdev rileysdev commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
  • Web reactively() yields { response, aborted } for every result, keeps reading across errors, and never throws. Same contract as Python (Python: reactively() yields (response, aborted) and never raises #204) and React.
  • Unauthenticated asks WebContext.onUnauthenticated to renew the session once before the error is yielded.
  • setRequest() restarts the read immediately; a stream the server closes reconnects with backoff.
  • Breaking: for await loops over reactively(), must destructure the item. Migration fragment included.
  • Docs: both tabs of "Calling readers reactively" pull from tested ChatRoom snippets; calls out that the Node.js ExternalContext cannot read reactively yet. This replaces the Fig snippet which looked weird out of context.

@aviator-app

aviator-app Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR is not ready to merge (currently in state pending): this PR has conversations which must be resolved before merging.

Pending Status Checks

  • ✅ 8 tests passing!

See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@rileysdev rileysdev changed the title React Web: .reactively() returns {response, aborted} React Web: .reactively() returns {response, aborted} Sep 30, 2026
@rileysdev rileysdev changed the title React Web: .reactively() returns {response, aborted} React Web: .reactively() returns { response, aborted } Sep 30, 2026
@rileysdev
rileysdev force-pushed the riley/reactive-reader-unification-web branch 7 times, most recently from bc262a5 to 4df9342 Compare September 30, 2026 22:59
…close

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rileysdev
rileysdev force-pushed the riley/reactive-reader-unification-web branch from 4df9342 to 78baf86 Compare September 30, 2026 23:09
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rileysdev
rileysdev force-pushed the riley/reactive-reader-unification-web branch from 78baf86 to d324466 Compare September 30, 2026 23:36
…snippets

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rileysdev
rileysdev force-pushed the riley/reactive-reader-unification-web branch from d324466 to 0e50e38 Compare September 30, 2026 23:57
@rileysdev
rileysdev marked this pull request as ready for review October 1, 2026 00:11
@rileysdev
rileysdev requested a review from benh October 1, 2026 00:11
@rileysdev rileysdev self-assigned this Oct 1, 2026
options?: { signal?: AbortSignal },
): Promise<[
AsyncGenerator<{{ client.proto.state_name }}.{{ method.proto.name }}Response, void, unknown>,
AsyncGenerator<reboot_web.ResponseOrAborted<{{ client.proto.state_name }}.{{ method.proto.name }}Response, {{ client.proto.state_name | to_camel }}{{ method.proto.name | to_camel }}Aborted>, void, unknown>,

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.

Just curious for all of the spellings of the aborted types, is there not a ChatRoom.MessagesAborted only a ChatRoomMessagesAborted?

If only the latter exists then no changes necessary, but if the former exists it would be great to use it everywhere!

async function* typedGenerator(): AsyncGenerator<reboot_web.ResponseOrAborted<{{ client.proto.state_name }}.{{ method.proto.name }}Response, {{ client.proto.state_name | to_camel }}{{ method.proto.name | to_camel }}Aborted>, void, unknown> {
for await (const { response, aborted } of generator) {
if (aborted !== undefined) {
yield { aborted };

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.

Just confirming aborted doesn't need to go through any kind of protobuf shape transformation?

Comment thread reboot/web/index.ts
onUnauthenticated !== undefined &&
!didRefresh
) {
didRefresh = true;

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.

Why only try and do the token refresh once aka call onUnauthenticated once? What if they fails because the backend happens to be restarting? Not sure where this is happening in httpCall as the comment states but it seems like retrying (with a backlog) is the safer way to do it? Unless onUnauthenticated is already retrying?

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants