delete + create in the same applyWrites makes `com.atproto.repo` RPCs behave incorrectly
did:plc:fp5zf7du5zntbwwcxkk3dppd opened this 19d ago 4 comments
did:plc:fp5zf7du5zntbwwcxkk3dppd opened 19d ago
when POSTing to /xrpc/com.atproto.repo.applyWrites with something like
{
"repo": "did:web:example.com",
"writes": [
{ "$type": "com.atproto.repo.applyWrites#delete",
"collection": "com.example.myrecord", "rkey": "3333333333333" },
{ "$type": "com.atproto.repo.applyWrites#create",
"collection": "com.example.myrecord", "rkey": "3333333333333",
"value": { "$type": "com.example.myrecord", "hello": "world" } },
]
}the delete and create go out on the event stream in the correct order, so AppViews reflect the write, but the AT-URI of the record is no longer present in com.atproto.repo.listRecords and 404s in com.atproto.repo.getRecord (but a valid carslice is returned from com.atproto.sync.getRecord !) - so com.atproto.repo APIs become out of sync with external views of the repo.
you can test this trivially with PDSls, since it has a "recreate" option in the advanced section of the record editor, which will emit a delete and create instead of an update.
No activity yet.