Skip to main content

Module fresh

Module fresh 

Source
Expand description

The sign-in of each account as its credentials file says now, not as the store last recorded it.

The store’s status is written at a spawn, and by the credential watch only when a file is emptied, and the watch needs two looks. A file emptied since the last spawn left the store at valid: the account list showed a sign-in a restart would find dead, and a switch moved an agent onto it. Every read that decides where an agent may go reads the file again.

ConstantsΒ§

REREAD_GAP πŸ”’

FunctionsΒ§

identity_list πŸ”’
Every account on this machine, statuses read now. BLOCKING (store and file reads).
refreshed πŸ”’
accounts with each status read from its file now.
status_after πŸ”’
status_now, with what happens between the two looks given (a pause, in production).
status_now πŸ”’
account’s status read from its credentials file. Only what the file proves moves it: no token in it is needs_reauth, and a live token turns a stored expired back to valid. A lapsed access token with a refresh token is left as stored, because the CLI renews it by itself and the file cannot say whether that will work. invalid (a provider refusal), needs_reauth and unknown are not re-read, and an account the file cannot speak for (no config dir, a Keychain on macOS) keeps the stored status.