kopia lustrzana https://github.com/snarfed/bridgy-fed
noop: move canonicalizing AT URIs TODO from ATProto to Object
rodzic
b8f55ec352
commit
b45635b125
|
@ -341,8 +341,6 @@ def poll_notifications():
|
|||
logger.info(f'Got {notif["reason"]} from {notif["author"]["handle"]} {notif["uri"]} {notif["cid"]}')
|
||||
|
||||
# TODO: verify sig
|
||||
# TODO: if notif.uri has handle, resolve and replace with DID
|
||||
# ...but that's probably unlikely, at least coming from AppView?
|
||||
obj = Object.get_or_create(id=notif['uri'], bsky=notif['record'],
|
||||
source_protocol=ATProto.ABBREV)
|
||||
if not obj.status:
|
||||
|
|
|
@ -502,6 +502,11 @@ class Object(StringIdModel):
|
|||
if self.key.id().startswith('at://'):
|
||||
repo, _, _ = arroba.util.parse_at_uri(self.key.id())
|
||||
if not repo.startswith('did:'):
|
||||
# TODO: if we hit this, that means the AppView gave us an AT URI
|
||||
# with a handle repo/authority instead of DID. that's surprising!
|
||||
# ...if so, and if we need to handle it, add a new
|
||||
# arroba.did.canonicalize_at_uri() function, then use it here,
|
||||
# or before.
|
||||
raise ValueError(
|
||||
f'at:// URI ids must have DID repos; got {self.key.id()}')
|
||||
|
||||
|
|
|
@ -398,7 +398,6 @@ class ATProtoTest(TestCase):
|
|||
requests_response({
|
||||
'cursor': '...',
|
||||
'notifications': [{
|
||||
# TODO
|
||||
'uri': 'at://did:plc:d/app.bsky.feed.like/123',
|
||||
'cid': '...',
|
||||
'author': eve,
|
||||
|
|
Ładowanie…
Reference in New Issue