Skip to content
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

feat(shuttle): Support deleting messages on DB that are missing on hub #2341

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

tybook
Copy link
Contributor

@tybook tybook commented Sep 27, 2024

There was existing support for handling messages that were present on hub and missing on DB, but not the opposite. From talking with Sanjay, it should be correct/safe to delete these messages from the DB.

Why is this change needed?

Shuttle only reconciled in one direction, even though everything appears 95% written to support both directions. This completes that. I know from adding logging to our Shuttle-powered app that that are a significant number of messages present in our DB that are missing in the hub.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review


PR-Codex overview

This PR introduces functionality to delete messages from the database that are not present on the hub, enhancing the message handling logic in the shuttle package.

Detailed summary

  • Updated handleMissingMessage method in HubEventProcessor to accept an optional missingInHub parameter.
  • Added logic to delete messages if missingInHub is true; otherwise, it merges them.
  • Adjusted calls to handleMissingMessage in app.ts to pass the new parameter.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

There was existing support for handling messages that were present on hub and missing on DB, but not the opposite. From talking with Sanjay, it should be correct/safe to delete these messages from the DB.
Copy link

changeset-bot bot commented Sep 27, 2024

🦋 Changeset detected

Latest commit: 0f45a55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@farcaster/shuttle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 9:21pm

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 58.43%. Comparing base (1880070) to head (509c81a).
Report is 378 commits behind head on main.

Files with missing lines Patch % Lines
packages/shuttle/src/shuttle/hubEventProcessor.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2341       +/-   ##
===========================================
- Coverage   74.05%   58.43%   -15.63%     
===========================================
  Files          99      138       +39     
  Lines        9425    19336     +9911     
  Branches     2097     6058     +3961     
===========================================
+ Hits         6980    11299     +4319     
- Misses       2327     7996     +5669     
+ Partials      118       41       -77     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sanjayprabhu sanjayprabhu merged commit 6408496 into farcasterxyz:main Oct 1, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants