"""`upsert`: a role stored as a pull stores it and then mapped, as the prep stage after the pull maps it. For tests of what the feed, the gates and the pages read, which are prep's values, not the raw ones `upsert_role` keeps.""" from __future__ import annotations from typing import Any from app import prep from app.storage import Store def upsert(store: Store, item: Any, subscription: Any = None) -> bool: new = store.upsert_role(item, subscription) prep.run(store, dupes=False) return new