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

fix: Allow syncTrie to handle names that are substrings #1546

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

sanjayprabhu
Copy link
Contributor

@sanjayprabhu sanjayprabhu commented Oct 26, 2023

Motivation

Fixes #1507. Makes all fnames unique by zero padding them.

Change Summary

Describe the changes being made in 1-2 concise sentences.

Merge Checklist

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

Additional Context

If this is a relatively large or complex change, provide more details here that will help reviewers


PR-Codex overview

Detailed summary

  • Added a new migration 5.fnameSyncIds to remove unpadded fname sync ids from the sync trie.
  • Updated the SyncId class to pad the name with null bytes to ensure all names have the same length.
  • Updated the validateFname function to use the USERNAME_MAX_LENGTH constant.
  • Added tests for handling names that are substrings of each other and names that end with 0.
  • Added a test for the fnameSyncIds migration to delete unpadded fname sync ids.

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

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2023

🦋 Changeset detected

Latest commit: f4d3765

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

This PR includes changesets to release 3 packages
Name Type
@farcaster/core Patch
@farcaster/hubble Patch
@farcaster/hub-nodejs 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

@vercel
Copy link

vercel bot commented Oct 26, 2023

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 Oct 26, 2023 9:20pm

@sanjayprabhu sanjayprabhu added the t-bug A fix for a bug with the current system label Oct 26, 2023
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...pps/hubble/src/storage/db/migrations/migrations.ts 90.47% <100.00%> (+1.00%) ⬆️
packages/core/src/validations.ts 87.40% <100.00%> (+0.03%) ⬆️
apps/hubble/src/network/sync/syncId.ts 92.40% <88.88%> (-0.46%) ⬇️
...hubble/src/storage/db/migrations/5.fnameSyncIds.ts 92.30% <92.30%> (ø)

... and 4 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@sanjayprabhu sanjayprabhu changed the base branch from main to 1_7_1 November 3, 2023 22:18
@sanjayprabhu sanjayprabhu merged commit 90536b4 into farcasterxyz:1_7_1 Nov 3, 2023
8 checks passed
@sanjayprabhu sanjayprabhu deleted the fix_fname_sync_trie branch November 3, 2023 22:18
sanjayprabhu added a commit that referenced this pull request Nov 9, 2023
* fix: disallow empty casts (#1555)

* fix: Fix peer check job not actually starting (#1559)

* fix: Allow syncTrie to handle names that are substrings (#1546)

* fix: Allow syncTrie to handle names that are substrings

* Add migration to delete unpadded fnames from syncTrie

* changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-bug A fix for a bug with the current system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Sync trie cannot handle keys that are are substrings of another
1 participant