Skip to content

Fix DO docs indentation & code errors#28156

Merged
elithrar merged 1 commit into
productionfrom
opencode/issue28155-20260206163134
Feb 6, 2026
Merged

Fix DO docs indentation & code errors#28156
elithrar merged 1 commit into
productionfrom
opencode/issue28155-20260206163134

Conversation

@ask-bonk

@ask-bonk ask-bonk Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

All tasks are complete. Here's a summary of all changes made to src/content/docs/durable-objects/best-practices/rules-of-durable-objects.mdx:

Indentation fixes (16 code blocks)

Fixed broken indentation in 16 of 29 code examples where code had either:

  • No indentation at all inside class methods/bodies (code flush to column 0)
  • Mixed 4-spaces + tab indentation instead of consistent tab-only indentation
  • 4 backticks (``````) closing code fences instead of standard 3 backticks (```)

All 27 occurrences of ```````` were replaced with standard ``` closings.

Affected code blocks:

  1. SeatBooking example (method body + export default)
  2. ChatRoom bad example (method body + export default)
  3. newUniqueId example (export default)
  4. Location hints example (export default)
  5. SQLite ChatRoom example (type definition + constructor + methods)
  6. In-memory state example (type definition + methods)
  7. Output gates example (method body)
  8. Race conditions example (method body)
  9. RPC ChatRoom example (type definition + methods + export default)
  10. Always await RPC example (export default)
  11. Hibernatable WebSockets example (all methods)
  12. Alarms GameMatch example (methods + try/catch block)
  13. deleteAll example (method body)
  14. Testing example (describe/it blocks)

Code correctness fixes (2 issues)

  1. locationHint API usage (line ~394): Moved locationHint from idFromName() to get(), which is the correct API placement per the Cloudflare Workers runtime.
  2. alarm() parameter type (line ~1307): Changed async alarm(alarmInfo) to async alarm(alarmInfo?: AlarmInvocationInfo) - added the proper type annotation and made the parameter optional to match the base class signature.

Closes #28155

github run

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@ask-bonk
ask-bonk Bot requested a review from a team February 6, 2026 16:40
@github-actions github-actions Bot added product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ size/l labels Feb 6, 2026
@elithrar
elithrar enabled auto-merge (squash) February 6, 2026 16:41

@elithrar elithrar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - reviewed and the type fixes are valid.

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/durable-objects/ @elithrar, @vy-ton, @joshthoward, @oxyjun, @lambrospetrou, @mikenomitch, @cloudflare/pcx-technical-writing

@elithrar
elithrar merged commit 2193b98 into production Feb 6, 2026
12 checks passed
@elithrar
elithrar deleted the opencode/issue28155-20260206163134 branch February 6, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix indentation and review code examples

6 participants