docs(api-server): note that broadcast_status has no production caller (#1163) - #1239
Open
gebibd00-jpg wants to merge 1 commit into
Open
docs(api-server): note that broadcast_status has no production caller (#1163)#1239gebibd00-jpg wants to merge 1 commit into
gebibd00-jpg wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AppState::broadcast_status(api-server/src/state.rs) is the only producer for theTransactionStatusEventchannel thatwebsocket::handle_socketreads from. A repo-wide grep shows it is invoked only fromapi-server/src/tests.rs— none ofhandlers.rs,websocket.rs,rpc.rs, ormain.rsever constructs or sends aTransactionStatusEvent.The result: a real client connecting to
/wsand subscribing to atx_idwill never receive astatus_updatemessage 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::simulateor a future submit / execute endpoint emit aTransactionStatusEventonce 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 ofwebsocket.rsin isolation is not misled into thinking the broadcast pipeline is a working feature.Change
An extensive doc comment on
broadcast_statuscapturing 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 toucheswebsocket.rsdoes not waste time debugging a pipeline that looks like it should work.Closes
#1163