feat(toncenter): document Streaming API v2#2049
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
|
from #2049 (comment):
Well, that's a bit unfortunate indeed, but it was intentional — this PR cannot be split into smaller ones without losing cohesion. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
ecosystem/api/toncenter/streaming/sse.mdx (1)
131-135: Clarify keepalive example as wire framing, not escaped string content.Using
: keepalive\n\ncan be read as literal backslash characters. Prefer showing real SSE lines to avoid client-implementation mistakes.Proposed doc tweak
-To keep the subscription alive, the server sends the following `keepalive` line every 15 seconds: +To keep the subscription alive, the server sends an SSE comment frame every 15 seconds: ```text -: keepalive\n\n +: keepalive +</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@ecosystem/api/toncenter/streaming/sse.mdxaround lines 131 - 135, The SSE
keepalive example currently shows escaped backslashes (": keepalive\n\n") which
can be misread; update the example in ecosystem/api/toncenter/streaming/sse.mdx
to show the actual wire framing lines instead of an escaped string — i.e.,
display a literal colon-prefixed comment line ": keepalive" followed by a blank
line (the terminating CRLF) so readers see the true SSE payload framing for the
keepalive message.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Inline comments:
In@ecosystem/api/toncenter/streaming/overview.mdx:
- Around line 88-92: The WebSocket Card component currently points to the SSE
route; locate the Card element with title="WebSocket" (the JSX element using
props title="WebSocket", icon="signal-stream") and change its href from
"/ecosystem/api/toncenter/streaming/sse" to the correct WebSocket route (e.g.
"/ecosystem/api/toncenter/streaming/websocket") so the WebSocket card links to
the WebSocket page.In
@ecosystem/api/toncenter/streaming/reference.mdx:
- Around line 66-68: This file uses the MDX component Aside but never imports
it, causing build errors; add an import for Aside at the top of the MDX (before
the first usage) — e.g. add a single-line import for the Aside component
from the project's MDX/component exports so the blocks at the spots
referencing action_types (the ones around the earlier usage and the repeated
block later) render correctly; ensure the same import covers both occurrences.In
@ecosystem/api/toncenter/streaming/sse.mdx:
- Line 143: Replace the escaped sequence "\~1 minute" with either a plain tilde
"~1 minute" or the phrase "about 1 minute" in the sentence describing
reconnection behavior to remove unnecessary backslash escaping and fix the
Markdown/formatter error; update the text near the reconnect guidance so it
reads e.g. "the previous connection may still be open for ~1 minute" or "about 1
minute" and ensure no extra backslashes remain.In
@ecosystem/api/toncenter/streaming/wss.mdx:
- Line 25: The sentence in the subscribe description ("Subscribe operation
replaces the entire subscription snapshot the current connection") is missing
the word "for"; update the Subscribe operation description in
ecosystem/api/toncenter/streaming/wss.mdx to read "Subscribe operation replaces
the entire subscription snapshot for the current connection" so the grammar is
correct and the meaning is clear.
Nitpick comments:
In@ecosystem/api/toncenter/streaming/sse.mdx:
- Around line 131-135: The SSE keepalive example currently shows escaped
backslashes (": keepalive\n\n") which can be misread; update the example in
ecosystem/api/toncenter/streaming/sse.mdx to show the actual wire framing lines
instead of an escaped string — i.e., display a literal colon-prefixed comment
line ": keepalive" followed by a blank line (the terminating CRLF) so readers
see the true SSE payload framing for the keepalive message.</details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: defaults **Review profile**: CHILL **Plan**: Pro **Run ID**: `85ceb47b-1f37-4ed7-99b6-acf367e9fc41` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between c9da5b6c05720a4cbe5ef11df6b89c89673f0e09 and b6a56afb8d19202b64e91da9e9460294c2140340. </details> <details> <summary>📒 Files selected for processing (9)</summary> * `docs.json` * `ecosystem/api/toncenter/introduction.mdx` * `ecosystem/api/toncenter/streaming/overview.mdx` * `ecosystem/api/toncenter/streaming/reference.mdx` * `ecosystem/api/toncenter/streaming/sse.mdx` * `ecosystem/api/toncenter/streaming/wss.mdx` * `ecosystem/api/toncenter/v2/overview.mdx` * `ecosystem/api/toncenter/v3/overview.mdx` * `ecosystem/subsecond.mdx` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ecosystem/api/toncenter/streaming/overview.mdx (1)
50-71: Tighten wording for consistency and readability.At Line 51, “very small” is a bit vague, and Lines 69–71 repeat the same sentence start. Consider a small wording pass for crisper tone.
Suggested wording tweak
-- `confirmed` — trace or transactions are included in a candidate shard block. Rollback chance is very small, but still possible. +- `confirmed` — trace or transactions are included in a candidate shard block. Rollback risk is low, but still possible. - - Use `pending` for the lowest latency. - - Use `confirmed` for lower rollback risk with near-real-time delivery. - - Use `finalized` when only settled data is acceptable. + - Choose `pending` for the lowest latency. + - Choose `confirmed` for lower rollback risk with near-real-time delivery. + - Choose `finalized` when only settled data is acceptable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ecosystem/api/toncenter/streaming/overview.mdx` around lines 50 - 71, Tighten the wording for clarity and consistency: replace vague phrasing like "very small" with a firmer term such as "unlikely" in the description of `confirmed`, remove the repeated sentence starts in the delivery recommendations (lines that begin with "Use") by consolidating or rephrasing into a single succinct guidance list, and ensure the terms `pending`, `confirmed`, `finalized`, `min_finality`, `account_state_change`, `jettons_change`, and `trace_invalidated` are used consistently and exactly as shown to avoid ambiguity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@ecosystem/api/toncenter/streaming/overview.mdx`:
- Around line 50-71: Tighten the wording for clarity and consistency: replace
vague phrasing like "very small" with a firmer term such as "unlikely" in the
description of `confirmed`, remove the repeated sentence starts in the delivery
recommendations (lines that begin with "Use") by consolidating or rephrasing
into a single succinct guidance list, and ensure the terms `pending`,
`confirmed`, `finalized`, `min_finality`, `account_state_change`,
`jettons_change`, and `trace_invalidated` are used consistently and exactly as
shown to avoid ambiguity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4365e9fe-2dd1-4e4e-bd63-026c9c865e35
📒 Files selected for processing (2)
ecosystem/api/toncenter/introduction.mdxecosystem/api/toncenter/streaming/overview.mdx
✅ Files skipped from review due to trivial changes (1)
- ecosystem/api/toncenter/introduction.mdx
There was a problem hiding this comment.
🧹 Nitpick comments (2)
ecosystem/api/toncenter/streaming/overview.mdx (2)
73-74: Improve transport-selection sentence clarityLine 73 reads awkwardly (“SSE and a WebSocket” / “its usage”). Consider tightening phrasing for smoother reading, e.g., “The Streaming API exposes two transports: SSE and WebSocket. Choose one transport to get started.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ecosystem/api/toncenter/streaming/overview.mdx` around lines 73 - 74, The sentence describing available transports is awkward; update the line that currently reads “The Streaming API exposes two transports: SSE and a WebSocket. Choose either of the transports to proceed with its usage:” to a clearer phrasing such as “The Streaming API exposes two transports: SSE and WebSocket. Choose one transport to get started.” Replace the original sentence in overview.mdx (the transport-selection sentence) accordingly to improve clarity and concision.
47-47: Polish wording for consistency in bulletsLine 47 uses “very small,” and Lines 65–67 start three consecutive bullets with “Use…”. Consider light rewording to improve tone and flow without changing meaning.
Also applies to: 65-67
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ecosystem/api/toncenter/streaming/overview.mdx` at line 47, Replace the phrasing in the `confirmed` bullet (the text containing the word "very small") to match the tone used elsewhere (for example change "very small" to "very unlikely") and adjust the three consecutive bullets that begin with "Use…" (the bullets referenced on lines 65–67) to vary wording for flow—e.g., rephrase one or two to start with alternate verbs or nouns while preserving meaning so the bullets no longer repeat the exact "Use…" opener.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@ecosystem/api/toncenter/streaming/overview.mdx`:
- Around line 73-74: The sentence describing available transports is awkward;
update the line that currently reads “The Streaming API exposes two transports:
SSE and a WebSocket. Choose either of the transports to proceed with its usage:”
to a clearer phrasing such as “The Streaming API exposes two transports: SSE and
WebSocket. Choose one transport to get started.” Replace the original sentence
in overview.mdx (the transport-selection sentence) accordingly to improve
clarity and concision.
- Line 47: Replace the phrasing in the `confirmed` bullet (the text containing
the word "very small") to match the tone used elsewhere (for example change
"very small" to "very unlikely") and adjust the three consecutive bullets that
begin with "Use…" (the bullets referenced on lines 65–67) to vary wording for
flow—e.g., rephrase one or two to start with alternate verbs or nouns while
preserving meaning so the bullets no longer repeat the exact "Use…" opener.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9b799bc1-4dfd-4eec-b48e-56c032007647
📒 Files selected for processing (1)
ecosystem/api/toncenter/streaming/overview.mdx
Kaladin13
left a comment
There was a problem hiding this comment.
two security comments, overall good
Closes #1984.
Summary by CodeRabbit