A browser session is declared, never created by hand - #267
Merged
Conversation
czpython
force-pushed
the
worktree-eng-855-lazy-session-rows
branch
from
August 17, 2026 08:26
108348c to
dda6171
Compare
A session exists because an extension declares it; the stored row is a cache of what happened to it — login state, payload, timestamps — created by the first action that needs one: a workflow borrow, a login-window open, or a state import. The pane renders declarations joined with rows and writes nothing; a declared-but-unused session lists wanting its first login, and a row whose extension is gone lists as a leftover with delete as its only action. The wire is name-addressed — the declared name is the identity — and the list is its only read: every mutation answers 204, the per-session GET is gone, and the login window keys its Redis record by session name so the window routes never visit the database. Manual creation and rename leave the API and the UI. State uploads carry their payload format and stamp it on the row, as the borrow write-back already does. The manual login loop imports through the same lazy door, and row creation copies the ON CONFLICT DO NOTHING idiom so racing first actions converge.
czpython
force-pushed
the
worktree-eng-855-lazy-session-rows
branch
from
August 17, 2026 08:44
5335f85 to
b0a6cb1
Compare
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.
A browser session exists because an extension declares it on its Extension
class. The stored row is a cache of what happened to that session — its
login state, its timestamps, its payload — not the session's identity. So
nothing creates a session by hand any more, and nothing materializes rows
ahead of time either.
Rows appear on the first action that needs one: a workflow borrowing the
login, an operator opening the login window, or a state import. Views only
read. Opening the sessions pane writes nothing to the database.
The pane now renders the declarations, joined with whatever rows exist. A
session that has been declared but never used shows up wanting a login,
which is how the operator learns an extension needs one — previously it was
invisible until something borrowed it, so the first login had nowhere to
start. A row whose declaring extension is gone still lists, marked as no
longer declared, with delete as its only action.
The wire is addressed by name, since the declared name (
x_me.x) is theidentity;
idleaves the response. Manual creation and rename are gone fromboth the API and the UI — a renamed row would just orphan itself from its
declaration. State uploads now carry their payload format as a query param
and stamp it on the row, the way the borrow write-back already stamps it;
without that, a lazily created row would default to a profile directory
while the importer uploads storage-state JSON.
scripts/import_browser_session.pyno longer creates anything. It refuses aname no installed extension declares, and imports through the same lazy
door.