-
Notifications
You must be signed in to change notification settings - Fork 373
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: In r/demo/users, add ListUsersByPrefix #1708
feat: In r/demo/users, add ListUsersByPrefix #1708
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1708 +/- ##
==========================================
- Coverage 60.22% 60.21% -0.01%
==========================================
Files 562 562
Lines 75038 75038
==========================================
- Hits 45188 45182 -6
- Misses 26476 26479 +3
- Partials 3374 3377 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b740446
to
516a99d
Compare
Converted this PR to Draft while addressing the above comments and refactoring some functionality to p/demo/avlhelpers |
516a99d
to
fe81f9c
Compare
fe81f9c
to
1c6ae24
Compare
Signed-off-by: Jeff Thompson <[email protected]>
1c6ae24
to
04b8e70
Compare
Signed-off-by: Jeff Thompson <[email protected]>
04b8e70
to
19d9215
Compare
Finished updating the commits and PR description. Ready for review. |
Hey @jefft0, can you please merge in the latest |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feature 🙏
I left a comment concerning whether we want support for non-ASCII characters in the prefix
Signed-off-by: Jeff Thompson <[email protected]>
@jefft0 can you please resolve the conflict in the PR, so we can merge? 🙏 |
Signed-off-by: Jeff Thompson <[email protected]>
…gKeysByPrefix Signed-off-by: Jeff Thompson <[email protected]>
Hi @zivkovicmilos . I resolved the conflict. (Since I opened this PR, the master branch merged a file z_11_filetest.gno . So I just renamed my file to z_12_filetest.gno .) |
Signed-off-by: Jeff Thompson <[email protected]>
…th preloaded namespaces Signed-off-by: Jeff Thompson <[email protected]>
Since I opened this PR, r/demo/users is now pre-loaded with namespace names. So I updated z_12_filetest.gno to use a different test name that doesn't conflict. The test passes again. |
…n ListByteStringKeysByPrefix Signed-off-by: Jeff Thompson <[email protected]>
GnoSocial uses r/demo/users to register users. A typical social app can search for other users by name, which requires a search box with partial match. The private variable
name2User
is an avl.Tree where the key is the user name, and avl.TreeIterate
can already iterate by start and end values. This PR has 2 commits:ListByteStringKeysByPrefix
. Also add tests.ListUsersByPrefix
to return a list of user names starting from the given prefix.For example,
ListUsersByPrefix("g", 2)
returns a list of 2 names with the prefix "g":In the GnoSocial demo app, we plan to use this in a search box.
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description