Skip to content

docs(realtime): document DataChannels reliability and ordering#32028

Open
harshith-cloudflare wants to merge 1 commit into
cloudflare:productionfrom
harshith-cloudflare:harshith/realtime-datachannel-reliability
Open

docs(realtime): document DataChannels reliability and ordering#32028
harshith-cloudflare wants to merge 1 commit into
cloudflare:productionfrom
harshith-cloudflare:harshith/realtime-datachannel-reliability

Conversation

@harshith-cloudflare

Copy link
Copy Markdown
Contributor

Summary

This PR is to document the datachannels reliability and ordering settings.

  • Add ordered, maxRetransmits, and maxPacketLifeTime to OpenAPI DataChannelObject
  • Document reliability on both local (publisher) and remote (subscriber) channels
  • Note that createDataChannel() must mirror the same options for negotiated channels

Documentation checklist

- Add ordered, maxRetransmits, and maxPacketLifeTime to OpenAPI DataChannelObject
- Document reliability on both local (publisher) and remote (subscriber) channels
- Note that createDataChannel() must mirror the same options for negotiated channels
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 1 warning, 💡 1 suggestion found in commit 74b37ed.

Fix in your agent
Fix the following review findings in PR #32028 (https://github.com/cloudflare/cloudflare-docs/pull/32028).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, fix all legitimate findings. For any you decide to skip,
post a comment on this PR with the finding ID and your reasoning.

---

## Code Review

### Warnings (1)

#### CR-b02196318aa6 · Missing HTTP response validation
- **File:** `src/content/docs/realtime/sfu/datachannels.mdx` line 132
- **Issue:** The new subscriber example awaits `fetch(...).then((r) => r.json())` (lines 116-132) without checking `r.ok`, so a 4xx/5xx error response is still parsed as JSON (or throws a `SyntaxError` for a non-JSON error body). The following `resp.dataChannels[0].id` (lines 135-136) then dereferences an undefined value, producing a confusing runtime error for users who copy the snippet.
- **Fix:** Add an `if (!r.ok)` check before `r.json()` and surface the API error, or guard `resp.dataChannels[0]` before indexing into the response.

---

## Style Guide Review

### Suggestions (1)

#### SG-0fcd5178820a · Use <TypeScriptExample> for TypeScript code blocks
- **File:** `src/content/docs/realtime/sfu/datachannels.mdx` line 77
- **Issue:** Line adds a raw ```ts fenced block in a docs MDX file
- **Fix:** Use the <TypeScriptExample> component instead; it auto-generates a JS tab

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (1)
File Issue
realtime/sfu/datachannels.mdx line 132 Missing HTTP response validation — The new subscriber example awaits fetch(...).then((r) => r.json()) (lines 116-132) without checking r.ok, so a 4xx/5xx error response is still parsed as JSON (or throws a SyntaxError for a non-JSON error body). The following resp.dataChannels[0].id (lines 135-136) then dereferences an undefined value, producing a confusing runtime error for users who copy the snippet. Fix: Add an if (!r.ok) check before r.json() and surface the API error, or guard resp.dataChannels[0] before indexing into the response.

Conventions

No convention issues found.

Style Guide Review

Suggestions (1)
File Issue
realtime/sfu/datachannels.mdx line 77 Use for TypeScript code blocks — Line adds a raw ```ts fenced block in a docs MDX file Fix: Use the component instead; it auto-generates a JS tab
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.

@irvinebroque

Copy link
Copy Markdown
Contributor

should this have an actual changelog? https://developers.cloudflare.com/changelog/

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.

5 participants