-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition: replies, deletes, undos, unfollows, etc get dropped if their target post is still processing #1361
Comments
Hah, race condition indeed. That reply (call it B) was to another reply (A) by the same author that was still processing when B came in. BF saw that A wasn't bridged, so it didn't bridge B either, due to the logic that replies to non-bridged post aren't bridged. Ugh. I can think of ways to solve this, but they're all complicated. I don't see an easy fix yet. (The log message was unrelated, we got two inbox deliveries of this reply and that log message was for the second one. Our logic for finding log messages is not the best 🤷) |
Let me know if you want me to file a different issue for this, but I'm pretty sure this is related to this issue https://fed.brid.gy/ap/@[email protected] <- this bot auto reposts any post from https://fed.brid.gy/ap/@[email protected] if certain conditions are met and it boosts them basically immediately after the post is created. It looks like Bridgy is seeing the boost but doesn't do anything about it (I'm guessing because Bridgy hasn't processed the original post yet) |
Ah, interesting, true! That does sound likely. |
Got another report of this, #1393 ^, for deletes. Probably the same issue. One way to fix this could be to error out if we get a reply, repost, quote, delete, or undo of an object that either we haven't seen yet or isn't bridged. We'd then retry the receive task 5m later, and then again 10m after that. I'm reluctant to do that though, since we get a lot of these, and the vast majority of the time, the object in question will never be bridged. We'd end up tripling our load for those incoming activities to fix a rare edge case. 😕 |
FWIW, I ended up fixing my issue by just delaying the boost by 30 seconds. Though I'm not sure how useful that info is for fixing the actual issue |
One complication is that I don't think there's any guarantee an e.g. Create won't be sent after its matching Delete in ActivityPub (unless the instance cancels relevant outbox items (synchronously), which Mastodon doesn't appear to do at all). Backoff due to connectivity issues can sporadically (and individually explicitly somewhat randomly!) reorder activities across a long time span, at least in Mastodon. Mastodon fixes this problem with a database lock on the post id and by permanently tombstoning e.g. statuses it receives a Delete for. That creates significant 'garbage' of course, which I don't think exists as such in ATProto. I think it also asynchronously fetches the target of an Announce if it doesn't have it already, but I think in bridgy's case it would probably be better to create a trigger with a timeout somehow that resumes processing in case the post is in fact bridged, unless it's a self-boost. (Can that even reliably be distinguished without fetching the Announced post, though?) |
Related: #1338 |
This did happened to me too! I forgot to mark my post as mention only lol, and deleted it second after it get posted. Bsky post link: https://bsky.app/profile/mashi.wip.la/post/3laciq5hih5p2 |
Just stumbled upon it as well 😆 https://bsky.app/profile/dos.social.librem.one.ap.brid.gy/post/3lau4ps7fqe62 It seems quite serious to me. If I delete something soon after posting, it's very likely because I really don't want it to stay there. |
Ah, this happened to me too! :') is there a way to force delete posts on bluesky? 👀 |
Same, it'll be nice if there's at least a way to delete it |
I should probably put the @snarfed I think there does need to be some level of general One option would be to have any If the That should be fairly reasonable load-wise, at least if the URIs can be prefix-deduplicated or otherwise compressed in the database. |
Agreed on the safety label and priority here. Re design, we could definitely add persistence for |
Another approach here could be to delay initial processing of |
One possible way to work around this in the short term could be to add a button to posts on That way, if someone notices weirdness, they could click something to fix it! Also, because this would just be a "refresh", you also wouldn't need to worry about authentication, or users trying to delete other people's posts |
^ I shipped a 2m delay for delete, undo, and stop-following, which should hopefully fix this. Fingers crossed! |
Thank you! But how about the existing deletes that failed to bridge before? Is there anything we can do? |
@atouu I can delete them manually. I've already deleted the one you mentioned in #1361 (comment) . Let me know if you have others! |
Like, in this issue directly? Or..? |
Yup! Here is fine, or emailed to [email protected]. I'd fix them myself if there was an obvious way to find them in our logs, but sadly there isn't. |
A reply just (sporadically?) didn't make it to Bluesky. The log at https://fed.brid.gy/log?path=%2Fqueue%2Fwebmention%2C%2Finbox&start_time=1728105708&key=https%3A%2F%2Fwolfdo.gg%2Fnotes%2F9yz9tw8dfgws6ex9%2Factivity shows the following
Relevant thread on Bluesky: https://bsky.app/profile/qazm.bsky.social/post/3l5qmbrxis223
That looks like a race condition somewhere in the ActivityPub inbox to me.
(This activity doesn't have the green checkmark for delivering it to Bluesky.)
The text was updated successfully, but these errors were encountered: