Skip to main content

resolve_account

Function resolve_account 

Source
pub fn resolve_account(
    id_store: &Arc<Store>,
    identity_store: &Arc<Store>,
    account_id: &str,
) -> Result<Option<(IdentityAccount, Arc<Store>)>, StoreError>
Expand description

Resolve an account by id, checking id_store first — the authoritative, per-account-isolatable primary, which is what preserves the disposable-test-account isolation guarantee — and falling back to identity_store’s read-through mirror (IDENTITY_STORE_SCHEMA_VERSION v2, docs/specs/SPEC_IDENTITY_STORE_SPLIT_2026_08_17.md §3.1) only when the primary lookup misses. Returns the account alongside WHICH store it came from, so a caller that later writes a status update (the OAuth expiry probe below) writes it back to the SAME store instead of always assuming id_store — writing to the wrong store would silently create a second, never-read copy.

reagentx P0 review on PR #2632: before this, the link resolved via identity_store (always global) but the account it pointed at could still only exist in id_store, which is empty on a fresh, isolated channel — the reported continuity bug wasn’t actually fixed end to end without this fallback.