Skip to content
Commit Detail

Commit 82d96dc

Author
JT Olio <jolio@cloudflare.com> 2026-04-17 14:54:12 -0400
Parents
49ee782
Tree
b260ce7
Create primaryStub and deprecate 'primary' field.

The 'primary' field name is confusing, as it is easy to read
code like

    if (!this.ctx.storage.primary)

and assume it's a boolean, not a stub. you might think the
above is a test to make sure we're not the primary, but
because the primary stub is set only on replicas, it's the
opposite!

    if (!this.ctx.primaryStub)

is easier to read and understand that this is an 'if' checking
if we're the primary.

This change also moves the registration location to be outside
of .ctx.storage.

X-Dest-Branch: jolio/add-ctx-primaryStub

Files changed