mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
Every JSON API answer carries `Connection: close` and the server runs its service on a single thread, so each request costs a full TCP handshake and they are answered one at a time. Over loopback a round trip is 0.1 ms and none of this shows; over WiFi or 4G it is 20 to 80 ms and the three patterns below turn into seconds of blank screen. Chat room list: one getChatLobbyInfo per subscribed room, and nothing was painted until the last answer arrived -- then only did the public room list get asked for. Paint each room as it lands and start the public list immediately. Forum post bodies: loadPostContent() is called from the view, and the body stays null for the whole round trip, so every redraw fired the same getForumContent again -- and each of the other posts' answers causes a redraw. An open thread multiplied one request per post into one per post per redraw. Guarded by an in-flight set, kept on failure so an unavailable post is asked for once per visit rather than forever. Chat history preload: two getMessages per known identity, hundreds of them at once, filling the browser's six sockets and the single service thread while the user waits for something else. Run four at a time. The duplicated response handling of the two branches is now one function. |
||
|---|---|---|
| .. | ||
| app | ||
| assets | ||
| make-src | ||
| .editorconfig | ||
| .nvmrc | ||
| .prettierrc | ||
| eslint.config.mjs | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| styles.css | ||