Problem
A branched application reaches its branch only through import { databases } from 'harper'. The bare databases and tables globals are process-wide and reach the base, silently (components/Application.ts:125-128).
In an isolated application's dedicated worker, the globals belong to that one application, so they could resolve to its branches. #642 lists per-application globals under thread isolation. Until then, a PR preview of an application that uses the globals writes to the shared data it was supposed to fork.
Proposal
In a dedicated worker whose application declares branchedDatabases, resolve the global databases, tables and defineTable through the same branch view as the scoped exports.
Part of #3042.
Problem
A branched application reaches its branch only through
import { databases } from 'harper'. The baredatabasesandtablesglobals are process-wide and reach the base, silently (components/Application.ts:125-128).In an isolated application's dedicated worker, the globals belong to that one application, so they could resolve to its branches. #642 lists per-application globals under thread isolation. Until then, a PR preview of an application that uses the globals writes to the shared data it was supposed to fork.
Proposal
In a dedicated worker whose application declares
branchedDatabases, resolve the globaldatabases,tablesanddefineTablethrough the same branch view as the scoped exports.Part of #3042.