Skip to content

Scrollbar panick on !json with line too long #469

Closed

Description

@gwitrand-ovh

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

Activity

  1. LucasPickering commented on Feb 19, 2025

    @LucasPickering
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions