atproto_firehose.handle bug fix: deletes don't have records

for #1162
pull/1167/head
Ryan Barrett 2024-07-06 14:47:03 -07:00
rodzic 2189652a1d
commit df75e97880
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
4 zmienionych plików z 2 dodań i 5 usunięć

Wyświetl plik

@ -37,7 +37,6 @@ from common import (
PRIMARY_DOMAIN,
PROTOCOL_DOMAINS,
redirect_wrap,
report_error,
subdomain_wrap,
unwrap,
)

Wyświetl plik

@ -193,7 +193,6 @@ class ATProto(User, Protocol):
+ tuple(as1.CRUD_VERBS)
+ ('block', 'follow', 'like', 'share', 'stop-following')
)
SUPPORTED_RECORD_TYPES = frozenset(
type for type in itertools.chain(*FROM_AS1_TYPES.values())
if '#' not in type)

Wyświetl plik

@ -26,7 +26,6 @@ from common import (
create_task,
global_cache,
global_cache_timeout_policy,
report_error,
report_exception,
USER_AGENT,
)
@ -276,7 +275,7 @@ def handle(limit=None):
assert cursor
def _handle(op):
if op.record['$type'] not in ATProto.SUPPORTED_RECORD_TYPES:
if op.record and op.record['$type'] not in ATProto.SUPPORTED_RECORD_TYPES:
logger.info(f'Skipping unsupported type {op.record["$type"]}: {json_dumps(op.record, indent=2)}')
return

Wyświetl plik

@ -472,7 +472,7 @@ class ATProtoFirehoseHandleTest(TestCase):
def test_delete(self, mock_create_task):
new_commits.put(Op(repo='did:plc:user', action='delete', seq=789,
path='app.bsky.feed.post/123', record=POST_BSKY))
path='app.bsky.feed.post/123'))
handle(limit=1)