kopia lustrzana https://github.com/snarfed/bridgy-fed
atproto_firehose subscriber: bug fix for #account/identity events for non-bridged repos
rodzic
2dde62cd40
commit
d95724ff67
|
|
@ -206,9 +206,8 @@ def subscribe():
|
|||
logger.debug(f'Got {t[1:]} {repo}')
|
||||
commits.put(Op(action='account', repo=repo, seq=seq,
|
||||
time=cur_timestamp))
|
||||
continue
|
||||
continue
|
||||
|
||||
assert t == '#commit'
|
||||
blocks = {} # maps base32 str CID to dict block
|
||||
if block_bytes := payload.get('blocks'):
|
||||
_, blocks = libipld.decode_car(block_bytes)
|
||||
|
|
|
|||
|
|
@ -369,6 +369,22 @@ class ATProtoFirehoseSubscribeTest(ATProtoTestCase):
|
|||
commits.get())
|
||||
self.assertTrue(commits.empty())
|
||||
|
||||
def test_account_event_user_not_bridged(self):
|
||||
time = NOW.isoformat()
|
||||
|
||||
FakeWebsocketClient.to_receive = [({
|
||||
'op': 1,
|
||||
't': '#account',
|
||||
}, {
|
||||
'seq': 789,
|
||||
'did': 'did:plc:nope',
|
||||
'time': time,
|
||||
})]
|
||||
|
||||
self.subscribe()
|
||||
|
||||
self.assertTrue(commits.empty())
|
||||
|
||||
def test_uncaught_exception_skips_commit(self):
|
||||
self.cursor.cursor = 1
|
||||
self.cursor.put()
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue