Account Lifecycle Best Practices #3175
bnewbold
started this conversation in
Protocol (atproto)
Replies: 1 comment 1 reply
-
Perhaps for account migration the old PDS should emit a different event type or status - do differentiate from ''deactivated ? Or no event at all - nothing should rely on this, the old PDS may be gone or not cooperating. Or at least clarify that old PDS will have active=true. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a section of the Account Hosting specification which we have pulled out to a less formal document for now.
This document summarizes the expected behaviors for a few common account lifecycle transitions, and what firehose events are expected in what order. Software is generally expected to be resilient to partial or incorrect event transmission.
New Account Creation: when an account is registered on a PDS and a new identity (DID) is created.
#identity
event. It is good, but not required, to wait until the handle is resolvable by third parties before emitting the event (especially, but not only, if the PDS is providing a handle for the account). The account status may or may not beactive
when this event is emitted.active
to API requests for account status, an#account
event can be emittedrev
andcommit
, a#commit
message can be emitted. The initial repo may be "empty" (no records), or may contain records.#identity
,#account
,#commit
Account Migration: is described in more detail below, but the relevant events and behaviors are:
deactivated
on the new PDS (which will reply as such to API requests)#identity
eventactive
on the new PDS, it should emit an#account
event and a#commit
event; the order is not formally required, but doing#account
first is recommended. Ideally the#commit
event will be empty (no new records), but signed with any new signing key, and have a new/incrementedrev
.#account
event, indicating that the account is inactive and has statusdeactivated
.#account
and#commit
events which are not coming from the currently declared PDS instance for the identity: these should not be passed through to the output firehose. Further, they should ignore#commit
events when the local account status is notactive
. Overall, this means that account migration should result in three events coming from the relay: an#identity
(from new PDS), an#account
(from new PDS), and a#commit
(from new PDS). The#account
from the old PDS is usually ignored.rev
(when the#commit
is received), but otherwise don't need to take any action.Account Deletion:
#account
event, withactive
false and statusdeleted
.#account
event. If the Relay is a full mirror, it immediately stop servinggetRepo
,getRecord
, and similar API requests for the account, indicating the reason in the response error. The Relay may fully delete repo content locally according to local policy. The firehose backfill window does not need to be immediately purged of commit events for the repo, as long as the backfill window is time-limited.#commit
events for an account which is not "active'. If any further#commit
messages are emitted for the repo (eg, by accident or out-of-order processing or delivery), all downstream services should ignore the event and not pass it throughAccount takedowns work similarly to account deletion.
Account Deactivation:
#account
event, withactive
false and statusdeactivated
.#commit
events should not be emitted by the PDS, and should be ignored and not passed through if received by RelaysAccount suspension works similarly to deactivation.
Account Reactivation:
#account
event, withactive
status.#commit
event.#commit
event after reactivation to ensure downstream services are synchronizedBeta Was this translation helpful? Give feedback.
All reactions