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

Scrollbar panick on !json with line too long #469

Closed
gwitrand-ovh opened this issue Feb 19, 2025 · 1 comment · Fixed by #470
Closed

Scrollbar panick on !json with line too long #469

gwitrand-ovh opened this issue Feb 19, 2025 · 1 comment · Fixed by #470
Labels
bug Something isn't working

Comments

@gwitrand-ovh
Copy link

gwitrand-ovh commented Feb 19, 2025

Did you search for existing issues already? Yes

Describe the bug
Crash panicked when handling json! with a line in the json that is too long (166 chars)

thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.28.1/src/widgets/scrollbar.rs:570:10:
Scrollbar area is empty

To Reproduce

  1. Create a request with a body !json
  2. set the json value to have a line that is longer than 166 chars
  • If you have slumber opened, just click your request in the scrollbar, go to it and it will crash
  • if you didn't start slumber yet, it crashes on start
    ex that works:
body: !json
          {
            "one_very_lo_______________ng_keyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy": "{\"one_key_value_longgggggggg\":\"1234567891234567891234567891\"}"
          }

ex that crashed (1 extra char):

body: !json
          {
            "one_very_lo_______________ng_keyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy": "{\"one_key_value_longgggggggg\":\"12345678912345678912345678912\"}"
          }

Expected behavior
Not to crash

Screenshots
CF thread panick

Version (please complete the following information):

  • OS: Ubuntu 22
  • Terminal: any
  • Slumber Version: slumber 2.5.0

Additional context
Tried in embedded, with line returns, ... nothing works

@gwitrand-ovh gwitrand-ovh added the bug Something isn't working label Feb 19, 2025
@LucasPickering
Copy link
Owner

I'll put out a release today with the fix version this. I noticed you're on 2.5.0, the new version will be 3.0.1 which will require a major upgrade for you. It should be painless though; patch notes for 3.0.0 are here

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

Successfully merging a pull request may close this issue.

2 participants