-- Leo's gemini proxy

-- Connecting to bbs.geminispace.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

[#33] Streaming bugs and UX improvements


Two or three bugs with streamed gemtext in Lagrange (latest dev branch).


Bug 1: truncation

Occasionally, the streamed page is truncated in the output, even though the connection to server stays alive. It seems to always show complete lines, but sometimes all lines after some point are not shown, even if the stream is appended to. Test case:

gemini://sggs.thegonz.net/infstreamtest

This is running the following cgi shell script:

printf "20 text/gemini\r\n"
n=0
while true; do
    echo "$((n++))"
    if [ $((n%500)) -eq 0 ]; then
        sleep 1
    fi
    sleep 0.01
done

Running this locally, I find Lagrange truncates the page after some random number of lines, normally around 5-40. Without the "sleep 0.01" it sometimes gets into the thousands.


The CGI script continues running, and the tls connection is still up, and I can see from tcpdump that the network traffic continues. The connection closes once the tab is closed in lagrange.


Bug 2: refreshing

If I refresh a streaming page, Lagrange seems to consider it as a request to refresh the *previous* url. If that was itself a streaming page, another refresh will cause it to refresh the url before, and so on backwards through history. This seems unlikely to be what's wanted!



Arguable bug 3: no indication when stream appended to

One more thing, though not so clearly a bug. If the stream is appended to

while the user isn't scrolled down to the end, the only way the user can tell

is if they pay careful attention to the scroll bar. This is a problem for

things like SGGS or mozz's chat thingy, which append to the stream as a way of

notifying the user.


#bug #feature

🐞 Issue #33 in s/Lagrange-Issues

🚀 mbays

2023-06-11 ¡ 1 year ago


5 Comments ↓


🕹ī¸ skyjake [mod...] ¡ 2023-06-11 at 09:41:

I'm adding a #feature tag because there should be an officially recognized UI state where the tab is understood to be in streaming mode. The current behavior is mostly a side effect of waiting for a slow response to come in.


In the streaming mode the document updates could be done differently, perhaps even notifying the user somehow about new additions after a pause.


🚀 mbays [OP] · 2023-06-11 at 10:35:

@skyjake Hmm, I guess also if there's a lengthy pause due to network delays the user could want to know when new data comes in.


🚀 mbays [OP] · 2023-06-18 at 07:32:

This infstreamtest test seems to work fine on Android (I don't know what Lagrange version, but could find out). It remain broken with latest dev on my linux machine.


🚀 mbays [OP] · 2023-07-31 at 22:40:

Now I have seen the same truncation bug on Android (not with the test script linked above, but with something else similar which prints more on each line). The client becomes entirely unresponsive and needs to be restarted. (This may have been a fairly old version of lagrange for android, but the same bug is still observed on linux desktop with yesterday's latest git.)


Commit 6be6c24d ¡ Workarounds for issues with streaming requests

2023-08-11 ¡ 10 months ago


🕹ī¸ skyjake [mod...] ¡ 2023-08-11 at 15:28:

v1.16.7 has a workaround for Bug 1 and resolves Bug 2.


Testing with Gemski, sometimes the updated content has a partial line, with incomplete ANSI sequences of course. I should still improve this to ensure that during streaming updates only complete lines are included in the page.

-- Response ended

-- Page fetched on Sat Jun 1 09:38:12 2024