Skip to main content

Module muxbus_load

Module muxbus_load 

Source
Expand description

Finding a channel’s MuxBus tokens (Store::muxbus_load_tokens): one step per place they can be, tried in this order, the first that has them wins:

  1. this platform’s current layout (preferred_layout),
  2. the other platform’s layout, migrated in place (other_layout),
  3. the plaintext SQL columns of a row that predates keychain storage,
  4. the host-wide session of the same account, adopted once by a channel that signed in before tokens were scoped per channel.

A keychain READ failure at any step falls back to the plaintext SQL columns when they have data (read_failed): a transient storage failure must not present as a full logout while usable data sits right there.

allow_migration gates only the self-heal WRITES (false for muxbus_is_fresh’s side-effect-free contract, true for a normal load). The caller (muxbus_load_impl) already holds the store’s save lock and the channel’s cross-process lock.