docs: mark prototype-key workspace ids as unsupported by the entity editors

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLxwAsiXJ1Au8CBDBmH7iY
This commit is contained in:
Diego Imbert
2026-09-11 15:22:19 +02:00
co-authored by Claude Opus 5
parent 5155bf4708
commit 7945463dbe
3 changed files with 6 additions and 2 deletions
-2
View File
@@ -18,8 +18,6 @@ import { getWorkspaceRole, type RoleLookup } from '$lib/user'
export function useActingUser(workspace: () => string | undefined) {
const navWorkspace = fromStore(workspaceStore)
const navUser = fromStore(userStore)
// A Map, not an object: a workspace may legitimately be named `constructor`, which a plain
// object would answer for out of its prototype.
const looked = new SvelteMap<string, RoleLookup>()
// The workspace this effect last acted on, so arriving at one is distinguishable from the
// effect re-running while already there.
@@ -87,6 +87,9 @@
// releasing them on component teardown. `states` indexes the resulting
// handles by workspace ID for ergonomic lookup downstream.
let workspaceSpecs = $state<Array<{ ws: string; defaultValue: ResourceState }>>([])
// Plain objects keyed by workspace id, so an id that is also an `Object.prototype` key
// (`constructor`, …) reads as already present and the resource never loads. Such ids are
// deliberately unsupported: too unlikely to be worth guarding every read.
let initialStates: Record<string, ResourceState> = $state({})
let existedInitially: Record<string, boolean> = $state({})
let fetchedResources: Record<string, Resource> = $state({})
@@ -51,6 +51,9 @@
// releasing them on component teardown. `states` indexes the resulting
// handles by workspace ID for ergonomic lookup downstream.
let workspaceSpecs = $state<Array<{ ws: string; defaultValue: VariableState }>>([])
// Plain objects keyed by workspace id, so an id that is also an `Object.prototype` key
// (`constructor`, …) reads as already present and the variable never loads. Such ids are
// deliberately unsupported: too unlikely to be worth guarding every read.
let initialStates: Record<string, VariableState> = $state({})
let existedInitially: Record<string, boolean> = $state({})
let extraPerms: Record<string, Record<string, boolean>> = $state({})