fix(app): fail closed on invalid connection mode state #7

Open
Naveax wants to merge 2 commits from Naveax/pr/fix-connection-mode-persistence into main
pull from: Naveax/pr/fix-connection-mode-persistence
Naveax commented 2026-09-03 23:28:23 +03:00 (Migrated from github.com)

Summary

Harden connection-mode persistence and remove ambiguous legacy state restoration.

Only the explicit current proxy value restores SOCKS5 mode. Unknown or obsolete values fall back to TUN.

Changes

  • Restore SOCKS5 only from the current proxy value
  • Fail closed to TUN for unknown and legacy persisted values
  • Return the SharedPreferences write result from setMode
  • Do not update UI state when persistence fails
  • Show a save failure to the user

No changes are made to the actual TUN or SOCKS5 implementations.

## Summary Harden connection-mode persistence and remove ambiguous legacy state restoration. Only the explicit current `proxy` value restores SOCKS5 mode. Unknown or obsolete values fall back to TUN. ## Changes - Restore SOCKS5 only from the current `proxy` value - Fail closed to TUN for unknown and legacy persisted values - Return the SharedPreferences write result from setMode - Do not update UI state when persistence fails - Show a save failure to the user No changes are made to the actual TUN or SOCKS5 implementations.
The changes on this branch are already on the target branch. This will be an empty commit.
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin Naveax/pr/fix-connection-mode-persistence:Naveax/pr/fix-connection-mode-persistence
git checkout Naveax/pr/fix-connection-mode-persistence
Sign in to join this conversation.