ckampfe / russ

A TUI RSS reader with vim-like controls and a local-first, offline-first focus
GNU Affero General Public License v3.0
173 stars 18 forks source link

[BUG] Unable to get title for entry id * #19

Closed Cavernosa closed 1 year ago

Cavernosa commented 1 year ago

Is there an existing issue for this?

OS

{"label"=>"Linux"}

Current Behavior

When opening Mastodon feeds, this crash occurs:

thread 'main' panicked at 'Unable to get title for entry id [random number]', src/ui.rs:339:17
stack backtrace:
0: rust_begin_unwind at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/panicking.rs:64:14
2: russ::ui::draw
3: russ::main

Expected Behavior

No response

Steps To Reproduce

  1. Add a feed from any Mastodon user with at least one post (e.g. https://mastodon.social/@Gargron.rss)
  2. Navigate to the respective feed

Anything else?

Does not crash if the user never posted anything, or if the feed was hidden via the a key

ckampfe commented 1 year ago

Hi @Cavernosa thank you for the bug report. I think this is due to a quick hack I put in for the case where an entry doesn't have a title in the actual Atom/RSS. I don't know of a great way to handle this general other than defaulting to a placeholder title, so that's what I'm going to do. Look for a commit for that shortly. I'm going to push a quick fix but if you or anyone else has a better idea I'm open to hearing it.

ckampfe commented 1 year ago

Hm actually I think what I will do is to show a short, maybe 30-character preview of the content.

ckampfe commented 1 year ago

Eh on second thought, showing a preview is significantly more complication. Maybe I will get to it at some point but for now I will get this to stop crashing.

ckampfe commented 1 year ago

Fixed here https://github.com/ckampfe/russ/commit/e16c8022997f449b32de262252d03c2f98b80931