feat(shuttle): Revert unsafe "Support deleting messages on DB that are missing on hub" #2341 #2422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #2341
We found this to be a fundamentally flawed action to take on messages missing in the hub. Reverting the change to not mislead other Shuttle users.
Why is this unsafe? Imagine a simple Shuttle-powered app with a
links
table written to and deleted from by itshandleMessageMerge
method. Then imagine this series of Farcaster messages submitted to the network:Obviously the correct final
links
table state should be FID 123 following FID 234. But with my changes that I'm reverting here, this won't be the case. The hubs will eventually delete message 1, meaning Shuttle's reverse reconciliation would ultimately runhandleMessageMerge()
with astate
arg of"deleted"
on message 1. This means thelinks
table would have its row deleted that signifies FID 123 following FID 234, regardless of message 3.I think it might be safe in general to have this
onDbMessage()
callback do something like hard delete missing-in-hub messages from themessages
table to keep its disk usage in check, but calling into the app to have it perform all downstream deletion processing of the message like this isn't safe.PR-Codex overview
This PR focuses on reverting a previous change that allowed for the deletion of messages from the database if they were missing on the hub. It simplifies the
handleMissingMessage
method by removing the conditional check formissingInHub
.Detailed summary
handleMissingMessage
method inhubEventProcessor.ts
to remove themissingInHub
parameter.handleMissingMessage
inapp.ts
to reflect the removal of themissingInHub
argument.