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

BUG | failed to send tick event: SendError { .. } #12

Closed
mertssmnoglu opened this issue May 18, 2024 · 5 comments
Closed

BUG | failed to send tick event: SendError { .. } #12

mertssmnoglu opened this issue May 18, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@mertssmnoglu
Copy link
Sponsor Contributor

Describe the bug

I just want to try flawz without any arguments/flags to see how it results. It worked, but when I want to quit I expecting it to end without any logs but it gave me a panic warning.

thread '<unnamed>' panicked at src/event.rs:65:50
failed to send tick event: SendError { .. }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To reproduce

Steps to reproduce the behavior:

  1. Installed with sudo pacman -S flawz // Successful
  2. Run with 0 arguments and 0 flags, only flawz
  3. Waited to sync all CVEs
  4. All CVEs listed, pressed q to quit.

Expected behavior

Exiting with code 0 without any logs

Screenshots / Logs

20240518_23h12m29s_grim

Software information

  • Operating system: Arch GNU/Linux x86_64 6.8.9-zen1-2-zen
  • Rust version: rustc 1.73.0 (cc66ad468 2023-10-03)
  • Project version: 0.1.0-1

Additional context

I also tried to follow the guide on the logs,

First:

20240518_23h12m48s_grim
It gives null stack backtrace, I followed up with RUST_BACKTRACE=full

Second:

20240518_23h12m58s_grim

@mertssmnoglu mertssmnoglu added the bug Something isn't working label May 18, 2024
@orhun
Copy link
Owner

orhun commented May 19, 2024

Thanks for reporting!

I also experienced this issue a couple of times but I'm not sure why it is happening. I'm guessing maybe it is related to the timing of the tick event and quitting the TUI at the same time. I will investigate.

For some context, I initialized this project from the ratatui sync template, I wonder if that repo has the same issue as well.

@joshka
Copy link

joshka commented May 19, 2024

An error during send means the other side of the channel stopped listening. It's not an error that should be panicked on, it's the expected way to end the listening (unless you add cancellation in another way).

I haven't looked at the source for this, but either ignoring it this error, or exiting any loop, thread or task that it's called from is the right thing to do instead of panicking.

@orhun
Copy link
Owner

orhun commented May 20, 2024

@orhun
Copy link
Owner

orhun commented May 20, 2024

I removed the tick event (since it wasn't used anyways) so it should be good now.

@joshka
Copy link

joshka commented May 21, 2024

Just realized we panic on this in the template too:

* https://github.com/ratatui-org/templates/blob/main/simple/src/event.rs#L65

* https://github.com/ratatui-org/templates/blob/main/simple-async/src/event.rs#L51

There's a bug for this in ratatui/templates#49 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants