-
Notifications
You must be signed in to change notification settings - Fork 305
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
Better handle regex in pcli query watch
#4361
Conversation
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.
i have a question about the changes to the watch_changes
signature below!
_ => Some( | ||
regex::bytes::RegexBuilder::new(&request.nv_key_regex) | ||
.size_limit(MAX_REGEX_LEN) | ||
.unicode(false) |
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.
maybe we should add a comment here, remarking why the non-verifiable storage keys may not be valid unicode, compared to the verifiable storage keys?
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.
(i see this was already there, so this is not blocking)
see discussion from #4361, here: #4361 (comment)
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.
approving, modulo a question about the regex size limit mentioned in the original issue. nice! ✨
Describe your changes
This changes the
pcli query watch
command to fix a bug and improve usability.Previously, the
nv_key_regex
was implemented incorrectly. This PR also makes the watch command disable watching the other storage type if only a single regex is supplied.There is a slight drawback in the current implementation in that you cannot enable filtering the watch command for one of the regexes while supplying an empty regex for the other to view all matches, however changing this would require a change to the proto interface:
rpc Watch(WatchRequest) returns (stream WatchResponse);
Issue ticket number and link
Closes #4360
Checklist before requesting a review
If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: