Skip to content

docs(api-server): note that broadcast_status has no production caller (#1163) - #1239

Open
gebibd00-jpg wants to merge 1 commit into
Maki-Zeninn:mainfrom
gebibd00-jpg:docs/note-broadcast-status-stub
Open

docs(api-server): note that broadcast_status has no production caller (#1163)#1239
gebibd00-jpg wants to merge 1 commit into
Maki-Zeninn:mainfrom
gebibd00-jpg:docs/note-broadcast-status-stub

Conversation

@gebibd00-jpg

Copy link
Copy Markdown
Contributor

Summary

AppState::broadcast_status (api-server/src/state.rs) is the only producer for the TransactionStatusEvent channel that websocket::handle_socket reads from. A repo-wide grep shows it is invoked only from api-server/src/tests.rs — none of handlers.rs, websocket.rs, rpc.rs, or main.rs ever constructs or sends a TransactionStatusEvent.

The result: a real client connecting to /ws and subscribing to a tx_id will never receive a status_update message in production. The WebSocket subscribe / unsubscribe machinery (/ws, SubscribeMessage, MAX_SUBSCRIPTIONS_PER_CONNECTION, tx_subscribers, tx_status_tx) is fully wired up and well tested, but the production pipeline has no producer.

Wiring up a real producer (e.g. have handlers::simulate or a future submit / execute endpoint emit a TransactionStatusEvent once a transaction outcome is known) is a larger architectural change that is out of scope for a small fix. This change at least makes the stub state explicit so a future reader of websocket.rs in isolation is not misled into thinking the broadcast pipeline is a working feature.

Change

An extensive doc comment on broadcast_status capturing the stub status, the missing caller, the visible-but-silent production symptom, and a pointer to issue #1163 for follow-up. No behavior change, no tests, no API surface change — purely a maintainability comment so the next person who touches websocket.rs does not waste time debugging a pipeline that looks like it should work.

Closes

#1163

…Maki-Zeninn#1163)

`AppState::broadcast_status` (api-server/src/state.rs) is the only
producer for the `TransactionStatusEvent` channel that
`websocket::handle_socket` reads from. A repo-wide grep shows it
is invoked only from `api-server/src/tests.rs` -- none of
`handlers.rs`, `websocket.rs`, `rpc.rs`, or `main.rs` ever
constructs or sends a `TransactionStatusEvent`.

The result: a real client connecting to `/ws` and subscribing to a
`tx_id` will never receive a `status_update` message in
production. The WebSocket subscribe / unsubscribe machinery
(`/ws`, `SubscribeMessage`, `MAX_SUBSCRIPTIONS_PER_CONNECTION`,
`tx_subscribers`, `tx_status_tx`) is fully wired up and well
tested, but the production pipeline has no producer.

Wiring up a real producer (e.g. have `handlers::simulate` or a
future submit / execute endpoint emit a `TransactionStatusEvent`
once a transaction's outcome is known) is a larger architectural
change that is out of scope for a small fix. This change at
least makes the stub state explicit so a future reader of
`websocket.rs` in isolation is not misled into thinking the
broadcast pipeline is a working feature.

The change: an extensive doc comment on `broadcast_status`
capturing the stub status, the missing caller, the visible-but-
silent production symptom, and a pointer to issue Maki-Zeninn#1163 for
follow-up. No behavior change, no tests, no API surface change.
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