Repository navigation
Apps work in one organization at a time: delete an organization, keys and events by organization, the phone's switcher, the Recorder's organization - #1900
Open
davidmckayv wants to merge 4 commits into
Conversation
…an be held to one organization
Adds deleteOrganization (DELETE .../profile), refusing a person's own organization and default; organizationOnly on a new API key and organizationId on a key; organizationId on conversation events and on a Recorder connection; the realtime socket relayed at /api/v2/organizations/{organizationId}/realtime/websocket; and says a push device is registered per organization. Deprecates the role property of updatePerson in favour of updateOrganizationMember, sunset 2028-05-19, and reserves Intelligence's /api/v2/platform root.
Drops organizationOnly from a new key: every key is bound to the organization it was made in, and a key with no binding acts in default. ApiKey.organizationId says which, and createApiKey, the apiKey scheme and the changelog say so.
…ng the network in tests The support-window tests assumed the spec deprecates nothing, and their run of the check looked every release's spec up by tag, fetching each from GitHub once the spec marks something deprecated: it timed out in CI. SUPPORT_WINDOW_RELEASE_SPECS reads release specs from a directory instead, which the test points at its fixtures, and the tests now find the real deprecation of updatePerson's role.
… and events by organization, the phone's switcher, the Recorder's organization Web: an owner deletes an organization from its settings after typing its name; the server's refusal (a person's own organization, default, an unfinished delete) is shown in its own words, and the person moves to another of their organizations. Each API key's row names the organization it acts in (a key from before binding acts in default), and Create says where the key will work. Conversation events about another organization are ignored; events that name none are taken as before. Phone: a switcher on Home for a person in several organizations. The pick is kept on the phone and used while it is still one of theirs. Every signed-in request names its organization in OpenBot-Organization, the deployment is read in the person's organization once signed in rather than default, and signing out removes the device from each organization. Recorder: the connection keeps the organization its grant names and every request after the connect goes there, falling back to default when the grant names none.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 19, 2026 21:45
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The apps' part of working in one organization at a time. Built on the API additions in #1897; its three commits show here until it merges, after which this branch is rebased onto main.
Web
deleteOrganization. The server's refusals show in the dialog in its own words: a person's own organization,default, and a delete it couldn't finish. After a delete the person moves to another of their organizations and goes home, the same way leaving one works (the shared path is nowmoveOffGone). Admins and members aren't offered it.organizationId: nullwas made before keys were bound to an organization, so it acts indefaultand is shown under that organization's name. Create says "It works in only." The request sends only the name, because the address already names the organization.organizationIdnames another organization is dropped before it reaches the sidebar. It changes nothing and triggers no refetch. An event that names no organization is applied as before.Phone
OpenBot-Organization. It names the organization the address points to, or the current one for addresses that name none. The list of their organizations doesn't send it, because that list is how the current one is found.default. After sign-in it goes to the person's organization, becausedefaultmay not be one of theirs.Recorder
organizationIdfrom its grant. The keep-alive, identity, Learning, activity, live recording and Disconnect requests all go to that organization. A grant without one falls back todefault. Codes are still exchanged atdefault, because the code names the organization it was made for.organizationIdtoo (optional).Tests
app/tests/organization-delete.test.tsx: deleting with the name typed; the personal anddefaultrefusals; an unfinished delete followed by a retry; not offered to admins or members. The fake server's answers are checked against the generated zod schemas.app/tests/api-keys-screen.test.tsx: the organization on each row, including a key from before binding; Create says where the key works and sends{ name }only.app/tests/conversation-events-organization.test.tsx: uses the real hook and list query. Another organization's event does nothing; this organization's event, or one that names no organization, is applied.mobile/tests/generated-client.test.ts: the header on every signed-in request; the deployment read in the person's organization; a switch sends later requests to the picked organization and keeps the pick for the next sign-in; an organization the person isn't in is refused.tests/mobile-organization.test.ts: a kept pick is set aside once it's no longer one of theirs.extension/tests/recorder-organization.test.ts: a connection made in another organization keeps it, and the keep-alive and Disconnect go there; a grant with no organization stays indefault.Each new test failed against the base branch's source and passes with this change.
Screens were checked in headless Chromium and WebKit, light and dark, at 1280 and 390 wide, before and after. Before and after differ only where this change adds something.