Skip to content

The borrow marks its own session stale when the login bounces - #268

Merged
czpython merged 1 commit into
mainfrom
commonzenpython/session-signed-out
Aug 17, 2026
Merged

The borrow marks its own session stale when the login bounces#268
czpython merged 1 commit into
mainfrom
commonzenpython/session-signed-out

Conversation

@czpython

@czpython czpython commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Marking a session stale on a login bounce was platform bookkeeping in app code: x-me carried a dedicated durable step whose only job was giving that one write a transaction, because the mark must land while the failing harvest's transaction rolls back.

A FatalError can now name a signal to announce itself on when the run fails. The run machinery, after recording the failure, publishes that signal in its own retrying checkpoint — feature-blind, it just forwards the exception's declared facts (broadcast_topic + broadcast_facts, both empty by default). BrowserSessionSignedOutError (exported from druks.browser) names browser.session_signed_out and carries the session name; a browser subscriber marks that session stale off the signal.

The result:

  • The exception stays pure data — a code, a topic, a facts dict. No behavior, no side effects.
  • The core run loop imports nothing from the browser subsystem; it publishes whatever a fatal declares.
  • The reaction lives where it belongs — a declarative @subscribe in druks/browser/subscribers.py, durable and idempotent through the same publish-in-a-step machinery the run lifecycle already uses.

Flow: extension code raises BrowserSessionSignedOutError through the borrow. The door does one thing — stamps which session bounced. The run fails under browser_session_signed_out and publishes the bounce; the subscriber marks that session stale. The pane shows the stale session beside the failed run, further borrows are refused until the operator signs in again, and dead cookies are never written back. The workflow has nothing to catch; the next scheduled run proceeds once the login is back.

The descriptor's public mark_stale() loses its consumer and goes. The author guide teaches the raise. Two tests: the borrow test proves the door stamps the session and stores nothing; the durable test drives the reaction end to end — run failed under the code, row stale.

The x-me side (czpython/druks-apps#11) deletes its _mark_login_stale step, its local exception, and the whole catch: harvest raises the platform's exception and the body stays linear.

@czpython
czpython force-pushed the commonzenpython/session-signed-out branch 3 times, most recently from fafdad2 to 5a40fe0 Compare August 17, 2026 09:24
Marking a session stale on a login bounce was platform bookkeeping in app
code: x-me carried a dedicated durable step whose only job was giving that
one write a transaction, because the mark must land while the failing
harvest rolls back.

A FatalError can now name a signal to announce itself on when the run
fails. The run machinery, after recording the failure, publishes that
signal (its own retrying checkpoint) — feature-blind, it just forwards the
exception's declared facts. BrowserSessionSignedOutError names
'browser.session_signed_out' and carries the session name; a browser
subscriber marks that session stale off the signal.

So the exception stays pure data, the core loop imports nothing from the
browser subsystem, and the reaction lives where it belongs — a declarative
@subscribe, durable and idempotent through the existing publish machinery.
The door only stamps which session bounced; the workflow catches nothing;
the descriptor's mark_stale() is gone.
@czpython
czpython force-pushed the commonzenpython/session-signed-out branch from 5a40fe0 to b1933c2 Compare August 17, 2026 09:31
@czpython
czpython merged commit 1e242d5 into main Aug 17, 2026
1 check passed
@czpython
czpython deleted the commonzenpython/session-signed-out branch August 17, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant