From 8ce94360ae89ab7a3e564f6852b680a6890dbca9 Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Sat, 18 Jul 2026 16:08:29 -0700 Subject: [PATCH] docs(projects): requireProject() advisory is safe to read synchronously --- turnstone/shared_static/projects.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/turnstone/shared_static/projects.js b/turnstone/shared_static/projects.js index 86cbe249..1a285f2a 100644 --- a/turnstone/shared_static/projects.js +++ b/turnstone/shared_static/projects.js @@ -134,9 +134,12 @@ export function projectsError() { /** Whether this deployment requires new chats to be filed under a project * (server.require_project). ADVISORY only — the create endpoint on the - * enforcing node is authoritative. Fails OPEN to false on any refresh failure - * so the composer never hides options on a stale-true value; read it only - * AFTER {@link refreshProjects} resolves. */ + * enforcing node is authoritative. Reads the current cached value + * SYNCHRONOUSLY: before the first {@link refreshProjects} resolves it is the + * fail-open default false, so a synchronous read is safe — a composer can seed + * UI from the warm cache immediately and re-read after a refresh to catch a + * change. Fails OPEN to false on any refresh failure too, so the composer never + * hides options on a stale-true value. */ export function requireProject() { return _requireProject; }