The borrow marks its own session stale when the login bounces - #268
Merged
Conversation
czpython
force-pushed
the
commonzenpython/session-signed-out
branch
3 times, most recently
from
August 17, 2026 09:24
fafdad2 to
5a40fe0
Compare
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
force-pushed
the
commonzenpython/session-signed-out
branch
from
August 17, 2026 09:31
5a40fe0 to
b1933c2
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.
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
FatalErrorcan 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 fromdruks.browser) namesbrowser.session_signed_outand carries the session name; a browser subscriber marks that session stale off the signal.The result:
@subscribeindruks/browser/subscribers.py, durable and idempotent through the same publish-in-a-step machinery the run lifecycle already uses.Flow: extension code raises
BrowserSessionSignedOutErrorthrough the borrow. The door does one thing — stamps which session bounced. The run fails underbrowser_session_signed_outand 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_stalestep, its local exception, and the whole catch: harvest raises the platform's exception and the body stays linear.