-
Notifications
You must be signed in to change notification settings - Fork 13
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: watch register behalf #41
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.
Looks good! Added some comments.
relay_client/src/http.rs
Outdated
@@ -280,7 +288,11 @@ impl Client { | |||
let status = result.status(); | |||
|
|||
if !status.is_success() { | |||
return Err(HttpClientError::InvalidHttpCode(status).into()); | |||
let body = match result.text().await { |
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'd use result.text().await.unwrap_or_else(|err| format!("... error calling result.text(): {err:?}"))
. Also the message is a bit strange. Maybe it should be something like 'error reading response body'?
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.
@@ -66,7 +66,7 @@ fmt: | |||
|
|||
if command -v cargo-fmt >/dev/null; then | |||
echo '==> Running rustfmt' | |||
cargo +nightly fmt --all -- --check | |||
cargo +nightly fmt --all |
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.
Why the change? This was used for validation, along with clippy to make everything is all right before pushing. Formatting is usually done on the fly by the editor.
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.
My editor (vscode) doesn't format all of the way that cargo fmt
does, so cargo fmt
sometimes does extra stuff or I miss it in a certain file.
I use 1 command in my devloop, something like just fmt clippy test
. So when I get a formatting error then I have to manually run cargo fmt
. I'd rather it fix my formatting for me, rather than tell me it's wrong.
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. It hasn't been a problem for me, ever, in VSCode. Maybe you forgot to enable the +nightly
feature in your VSCode addons?
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 can check this, but either way, wouldn't it be better to auto-format instead of just checking? What if my VS Code is out-of-sync with my CI/just tooling?
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.
Sure, as long as we still check formatting on the CI.
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.
Absolutely! No doubt about that :)
Description
watch_register_behalf()
function which allows passing-throughregister_auth
payload from clientjust fmt
will auto-format instead of just--check
get_message_id()
refactor left-over from feat: expose message_id #39Resolves #40
How Has This Been Tested?
With archive refactor
Due Diligence