-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync lex: #account firehose event; account status errors; and getAccountStatus endpoint #2263
Changes from 11 commits
00ce729
a626d78
a78e623
618c61e
efbf94a
a0a111b
bd2ac10
a9dbdbe
673c7f6
2e122ef
07ac1fe
b9e1700
89b4bb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.sync.getRepoStatus", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["did"], | ||
"properties": { | ||
"did": { | ||
"type": "string", | ||
"format": "did", | ||
"description": "The DID of the repo." | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["did", "active"], | ||
"properties": { | ||
"did": { "type": "string", "format": "did" }, | ||
"active": { "type": "boolean" }, | ||
"status": { | ||
"type": "string", | ||
"description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", | ||
"knownValues": ["takendown", "suspended", "deactivated"] | ||
}, | ||
"rev": { | ||
"type": "string", | ||
"description": "Optional field, the current rev of the repo, if active=true" | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [{ "name": "RepoNotFound" }] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
"refs": [ | ||
"#commit", | ||
"#identity", | ||
"#account", | ||
"#handle", | ||
"#migrate", | ||
"#tombstone", | ||
|
@@ -118,7 +119,31 @@ | |
"properties": { | ||
"seq": { "type": "integer" }, | ||
"did": { "type": "string", "format": "did" }, | ||
"time": { "type": "string", "format": "datetime" } | ||
"time": { "type": "string", "format": "datetime" }, | ||
"handle": { | ||
"type": "string", | ||
"format": "handle", | ||
"description": "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details." | ||
} | ||
} | ||
}, | ||
"account": { | ||
"type": "object", | ||
"description": "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.", | ||
"required": ["seq", "did", "time", "active"], | ||
"properties": { | ||
"seq": { "type": "integer" }, | ||
"did": { "type": "string", "format": "did" }, | ||
"time": { "type": "string", "format": "datetime" }, | ||
"active": { | ||
"type": "boolean", | ||
"description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." | ||
}, | ||
"status": { | ||
Comment on lines
+138
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm alright with keeping There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to expand on the reasoning there a bit, I wanted to future-proof a bit against us adding additional status strings in the future. If simple infra implementations match on the status string to either make the account visible or not make the account visible (who knows what kind of weird match/switch control flow they might have), then adding a status code could result in the incorrect behavior. Making it a boolean flag makes the "is account visible or not" behavior very clear, with the status being more of an end-user-visible context and less of a high-stakes "is content redistributed at all". still agree with your point, just wanted to document that bit of thinking |
||
"type": "string", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. made a tweak here with token values we normally just use a see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be honest I am not even sure if we need tokens here— its possible it could be non-namespaced strings. In my mind the value in tokens is that it allows extensibility by other namespaces, especially in cases where it's friendly for applications to be able to use values that will never make it into the lexicon's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point - and I do tend to agree that this isn't a place that we're asking for extensibility on. Any changes should be part of the formal sync protocol 🤔 So maybe we just do hardcoded values? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be my vote! I still support keeping it an open union as a little safety net. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it feels like a place "hardcoded" would make sense. agree on keeping it open-union semantics. |
||
"description": "If active=false, this optional field indicates a reason for why the account is not active.", | ||
"knownValues": ["takendown", "suspended", "deleted", "deactivated"] | ||
} | ||
} | ||
}, | ||
"handle": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should results in
sync.listRepos
also include the hosting status, and perhaps generally have the same shape as this?