Open adonoho opened 6 hours ago
# <==
is the marker to the line that generated this ValueError
.
async def async_on_message(message, test_function, handler):
message = hose.parse_subscribe_repos_message(message)
if isinstance(message,
atproto.models.ComAtprotoSyncSubscribeRepos.Commit):
blocks = atproto.CAR.from_bytes(message.blocks).blocks # <== This is the line that creates the above trace.
for op in message.ops:
uri = atproto.AtUri.from_str("at://" + message.repo \
+ "/" + op.path)
raw = blocks.get(op.cid)
if raw:
record = get_or_create(raw, strict=False)
if record.py_type is not None:
rdict = record.model_dump()
item = {
"repo": message.repo,
"revision": message.rev,
"sequence": message.seq,
"timestamp": message.time,
"action": op.action,
"cid": str(op.cid),
"path": op.path,
"collection": uri.collection,
"record": rdict
}
if test_function(item):
await IOLoop.current().run_in_executor(None, handler, item)
Hi! Today is the day when everyone tries devil payloads over the network. These are special malformed messages that raise issues like that. It would help if you would catch the value of .blocks and write to the file. And pls share. Otherwise, just catch the ValueError exception and ignore this commit
OK, I'll try to get to this after dinner.
Happy to help and dig deeper.
Anon, Andrew