kopia lustrzana https://github.com/snarfed/bridgy-fed
ATProto.send: handle delete when we have Object but not contents
fixes https://console.cloud.google.com/errors/detail/COjSuYPS0qLvmAE;time=P30D?project=bridgy-federatedpull/1125/head
rodzic
4a2abbac5b
commit
5b7f8de8d6
|
@ -420,9 +420,9 @@ class ATProto(User, Protocol):
|
|||
if type in ('post', 'update', 'delete'):
|
||||
obj_as1 = as1.get_object(obj.as1)
|
||||
base_obj = PROTOCOLS[obj.source_protocol].load(obj_as1['id'])
|
||||
if not base_obj:
|
||||
if not base_obj or not (base_obj.as1 or base_obj.raw):
|
||||
if type == 'delete':
|
||||
logger.info("Can't delete, we don't have original object {obj_as1['id']}")
|
||||
logger.info(f"Can't delete, we don't have original object {obj_as1['id']}")
|
||||
return False
|
||||
base_obj = obj
|
||||
|
||||
|
|
|
@ -69,9 +69,9 @@ class ATProtoTest(TestCase):
|
|||
arroba.util.now = lambda **kwargs: NOW
|
||||
|
||||
def make_user_and_repo(self):
|
||||
self.user = self.make_user(id='fake:user', cls=Fake,
|
||||
copies=[Target(uri='did:plc:user',
|
||||
protocol='atproto')])
|
||||
self.user = self.make_user(
|
||||
id='fake:user', cls=Fake,
|
||||
copies=[Target(uri='did:plc:user', protocol='atproto')])
|
||||
|
||||
did_doc = copy.deepcopy(DID_DOC)
|
||||
did_doc['service'][0]['serviceEndpoint'] = ATProto.PDS_URL
|
||||
|
|
Ładowanie…
Reference in New Issue