makew0rld / amfora

A fancy terminal browser for the Gemini protocol.
GNU General Public License v3.0
1.14k stars 68 forks source link

For some reason if you go through any of the two links of this site amfora hangs #315

Closed lucasew closed 10 months ago

lucasew commented 2 years ago

I am developing a Gemini browser for native degoogled Android that I pretend to release at the end of the semester

During that development I stumbled with a bug: when I touch any of the two links on this site [1] agena raises an error but for some reason, amfora is also affected by the same bug.

Edit 1: Using amfora from nixpkgs

Amfora v1.9.2
Commit: unknown
Built by: unknown

Edit 2:

On Agena it raises an IllegalArgumentException in that case so if that happens I use a regex to filter out unexpected symbols and try again parsing the URL.

[1] gemini://g.mikf.pl/gemlog/2022-02-06-doings.gmi

makew0rld commented 2 years ago

I am not experiencing any hanging or freezing up. The links on that page are broken, because the person is putting a NO-BREAK SPACE (U+00A0) instead of a regular SPACE (U+0020). The Gemini specification states that link lines are defined as:

=>[<whitespace>]<URL>[<whitespace><USER-FRIENDLY LINK NAME>]

Where:

<whitespace> is any non-zero number of consecutive spaces or tabs

Is NO-BREAK SPACE included in that? Maybe, although I would guess that solderpunk would say no because it makes Gemini client implementations more complex. I suspect he only intended the regular space when writing "spaces". In any case, forming links this way is unexpected and will break a lot of clients. Authors should not do it.


Can you provide more information on what exactly is causing Amfora to freeze up? How are you "touch"ing the links? And what is the output of amfora -v?

Thank you, and good luck with your browser!

mkf commented 1 year ago

(sorry for an erroneous comment, already deleted it.)

Anyway, hello.

I am now wondering if i should correct the nbsp to a space considering it's a bug example now and i would break reproducibility 😆

It appeared there because i went for a flow involving many various text/document editors on various devices and esoteric operating systems and one must have done that

lucasew commented 1 year ago

Tbh I think that spacing issue is a nice way to make the spec more complete. What if Gemini gets more adoption and people start defacing sites to add these spaces just to crash the clients.

AGENA already deals with it and doesn't crash. The problem IMO is to fail silently.

makew0rld commented 1 year ago

The problem IMO is to fail silently.

@lucasew to be clear, this is what I observe on my end. I haven't been able to reproduce any crashing, at least not with the latest commit. As of right now, I consider this a non-issue.

I am now wondering if i should correct the nbsp to a space considering it's a bug example now and i would break reproducibility :laughing:

@mkf don't worry about fixing it, go right ahead :smile:. If you have the time you could add another page to your site with the broken links and put that URL here, as a test case.

makew0rld commented 10 months ago

Closing because this issue was never reproduced with the latest code.