Skip to content

feat(console): ping version 1 sockets and close them at session expiry - #1185

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/console-liveness
Nov 23, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
feat/console-liveness

Conversation

@TheMeinerLP

Copy link
Copy Markdown

Description

An open console in a browser could outlive the login that opened it, and a console left idle behind a proxy was cut off without a word. This change gives every version 1 socket a ping every 20 seconds, so a proxy never sees it silent, and closes a socket that was opened with a browser session at the moment that session ends (1008, unauthorized). A client that is gone is dropped when a ping cannot be written. Legacy sockets are untouched.

Stacked on #1181 (the base is its branch); it changes the same connection seam. Part of the task 4.7 of add-console-cli: this covers the pings and the close at expiry. The 60 second pong deadline is not here: Javalin does not hand pongs to a handler, so the server cannot yet tell a silent client from an answering one. That needs a decision from the maintainer.

Type of change

  • feat - new feature

How was this tested?

  • New ConsoleWebSocketLivenessTest (5 cases on the fake scheduler, no waits): ping every 20 seconds, a failed ping drops the connection, no ping after release, session expiry closes with 1008, a token connection has no expiry.
  • heavy ./gradlew --no-daemon --max-workers=2 :reposilite-backend:test --tests 'com.reposilite.console.*' passes.

Checklist

  • Commit messages follow the Conventional Commits convention documented in CLAUDE.md
  • Tests cover the change
  • ./gradlew build passes locally (the console tests ran; CI runs the full build)
  • Documentation and configuration samples are updated if the change is user-facing (nothing user-facing to configure)
  • Existing copyright headers are preserved; new files carry the appropriate header
  • No credentials, tokens or personal data are included in the diff

Base automatically changed from feat/console-cookie-hello to main November 23, 2026 01:06
A proxy in front of the server closes a socket that stays silent, so a
version 1 connection now gets a WebSocket ping every 20 seconds. A ping
that cannot be written drops the connection of a client that is gone.

A connection that authenticated with a browser session is closed with
1008 and the error code unauthorized when that session reaches its
expiry time, instead of staying open until its next command.

The web server does not hand pongs to the handler, so the 60 second
pong deadline is not part of this change.

Signed-off-by: TheMeinerLP <github@themeinerlp.dev>
@TheMeinerLP
TheMeinerLP force-pushed the feat/console-liveness branch from 6ec54bd to 4046148 Compare November 23, 2026 03:53
@github-actions

Copy link
Copy Markdown

Test results

  750 files    750 suites   9m 32s ⏱️
6 017 tests 6 005 ✅ 12 💤 0 ❌
6 080 runs  6 068 ✅ 12 💤 0 ❌

Results for commit 4046148.

@TheMeinerLP
TheMeinerLP added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit b09909e Nov 23, 2026
40 checks passed
@TheMeinerLP
TheMeinerLP deleted the feat/console-liveness branch November 23, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant