Skip to content

update deps #2107

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

Merged
merged 5 commits into from
Jan 31, 2021
Merged

update deps #2107

merged 5 commits into from
Jan 31, 2021

Conversation

dignifiedquire
Copy link
Collaborator

and switch to new channels in [email protected]

@link2xt
Copy link
Collaborator

link2xt commented Dec 18, 2020

There are warnings about unused results, more unwraps are needed.

@dignifiedquire dignifiedquire force-pushed the update-deps branch 2 times, most recently from 2d00d3e to f8ac0c2 Compare January 3, 2021 16:26
@dignifiedquire dignifiedquire requested a review from link2xt January 4, 2021 10:00
@@ -321,7 +321,7 @@ async fn start(args: Vec<String>) -> Result<(), Error> {
Ok(line) => {
// TODO: ignore "set mail_pw"
rl.add_history_entry(line.as_str());
async_std::task::block_on(reader_s.send(line));
async_std::task::block_on(reader_s.send(line)).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SendError shouldn't happen because the channel should never be closed, but I'd rather print the error instead of panic here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't happen, and it is just the repl, which is why an unwrap seems appropriate to me here

started
.send(())
.await
.expect("inbox loop, missing started receiver");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for all expect calls, can they be replaced with warnings written into logs? This way if someone accidentally kills the other side of the channel, we get an app that does not do networking, but still does not crash and allows to collect the log with these errors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried that if we don't panic, the app will be in a state in which it is unclear what is happening to the user, as it might seem to be working, except no incoming or outgoing messages are happening. So I would rather crash the app, ensuring it gets restarted and we get a crash report hopefully

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crash report will be hard to debug in this case. If nothing is sent/received, user will be able to send us a log, which is much more useful. Maybe throw an error!?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a pretty serious logic error that would not pass the integration test suite. It's sad that this can't be done using type-safety, but I agree that panicking here is best as otherwise it would be harder to detect in early testing.

started
.send(())
.await
.expect("inbox loop, missing started receiver");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a pretty serious logic error that would not pass the integration test suite. It's sad that this can't be done using type-safety, but I agree that panicking here is best as otherwise it would be harder to detect in early testing.

@flub
Copy link
Contributor

flub commented Jan 24, 2021

I took the liberty to update this, stop-token doesn't support async-std 1.9 yet so had to limit it to 1.8 for now which still provides the old channel API. If @dignifiedquire could have another look that I didn't screw anything up I think we should merge it.

@flub
Copy link
Contributor

flub commented Jan 24, 2021

I've created async-rs/stop-token#7 to allow us to move to async-std 1.9. Hopefully they'll merge and release something like that soon.

@flub flub merged commit 5ee4bb5 into master Jan 31, 2021
@flub flub deleted the update-deps branch January 31, 2021 11:46
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.

3 participants