kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
5bcb230d39
commit
755997e5f7
|
@ -78,7 +78,8 @@ def _load_dids():
|
|||
new_atproto = [key.id() for key in atproto_query.iter(keys_only=True)]
|
||||
atproto_dids.update(new_atproto)
|
||||
|
||||
bridged_query = AtpRepo.query(AtpRepo.created > bridged_loaded_at)
|
||||
bridged_query = AtpRepo.query(AtpRepo.status == None,
|
||||
AtpRepo.created > bridged_loaded_at)
|
||||
bridged_loaded_at = AtpRepo.query().order(-AtpRepo.created).get().created
|
||||
new_bridged = [key.id() for key in bridged_query.iter(keys_only=True)]
|
||||
bridged_dids.update(new_bridged)
|
||||
|
|
|
@ -84,3 +84,8 @@ indexes:
|
|||
properties:
|
||||
- name: updated
|
||||
- name: enabled_protocols
|
||||
|
||||
- kind: AtpRepo
|
||||
properties:
|
||||
- name: status
|
||||
- name: created
|
||||
|
|
|
@ -429,6 +429,17 @@ class ATProtoFirehoseSubscribeTest(TestCase):
|
|||
})
|
||||
self.assertIn('did:plc:eve', atproto_firehose.bridged_dids)
|
||||
|
||||
def test_load_dids_tombstoned_atprepo(self):
|
||||
FakeWebsocketClient.to_receive = [({'op': 1, 't': '#info'}, {})]
|
||||
|
||||
AtpRepo(id='did:plc:eve', head='', signing_key_pem=b'',
|
||||
status=arroba.util.TOMBSTONED).put()
|
||||
|
||||
self.subscribe()
|
||||
|
||||
# tombstoned AtpRepo shouldn't be loaded into bridged_dids
|
||||
self.assertNotIn('did:plc:eve', atproto_firehose.bridged_dids)
|
||||
|
||||
|
||||
@patch('oauth_dropins.webutil.appengine_config.tasks_client.create_task')
|
||||
class ATProtoFirehoseHandleTest(TestCase):
|
||||
|
|
Ładowanie…
Reference in New Issue