Skip to content

feat(auth): handle server-side deletion of inactive sessions - #33

Merged
MaxDac merged 1 commit into
mainfrom
maxdac-handle-server-side-session-deletion
Oct 9, 2026
Merged

MaxDac merged 1 commit into
mainfrom
maxdac-handle-server-side-session-deletion

Conversation

@MaxDac

@MaxDac MaxDac commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Description

Handles the server-side cleanup from MaxDac/Privee#178. The server now deletes inactive sessions, then answers their log in with 401 invalid_credentials. The API is unchanged and there is no api_version bump.

  • Clear message: the new KnownSessionStore records, encrypted under noBackupFilesDir, the session names and ids signed into on each server (sessions.bin). If a log in to one of those names gets a 401 or 404, the auth screen says the session no longer exists on the server because it was deleted after inactivity. It also shows a Create a new session button that opens registration with the name already filled in. The message is translated into en, it, pt-PT, es and fr. Unknown names still get the generic "wrong credentials" message.
  • Push re-registration: the new PushEndpointSync keeps the endpoint returned by the distributor and sends it again with PUT /api/app/push after every new sign-in. The existing register-on-sign-in flow is unchanged. The cached endpoint is cleared on sign-out and when the distributor unregisters the app.
  • Stale state (optional item): if a known name signs in again with a different id, the old session was deleted. The app then deletes that id's signal-<id>.bin. "Forget device" also removes the name from the store.
  • Docs: ARCHITECTURE.md and TECHNOLOGIES.md.

E2EE is unaffected. No keys or content are added to logs, push payloads or backups.

Closes #32

Checklist

  • No secrets committed (API keys, endpoints, tokens, .jks, .env)
  • :core:* modules contain no android.* / androidx.* imports
  • Tests pass (./gradlew test)
  • Commit messages follow Conventional Commits

Validation: ./gradlew test :app:lintDebug :app:assembleDebug passed locally. New tests: KnownSessionStoreTest, PushEndpointSyncTest, AuthProblemTest, and an invalid_credentials log-in case in PriveeApiTest. Not done: an end-to-end run on an emulator against a local server.

Remember the sessions signed into on each server, so a refused log in to one of them says the session no longer exists on the server and offers to create a new one. Send the push endpoint again after every new sign-in, and drop the Signal state of a deleted session when its name comes back with a new id. Follows MaxDac/Privee#178; no API change.

Closes #32

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 82bbdd2c-9933-4e50-bf78-77857791af0c
@MaxDac
MaxDac merged commit 3c3f104 into main Oct 9, 2026
5 checks passed
@MaxDac
MaxDac deleted the maxdac-handle-server-side-session-deletion branch October 9, 2026 14:06
@MaxDac MaxDac mentioned this pull request Oct 9, 2026
4 tasks done
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.

Handle server-side deletion of inactive sessions

1 participant