Expand test coverage and fix lifecycle contracts

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-08-23 08:55:24 +08:00
parent 68ad1eefc1
commit 185bc784cb
13 changed files with 1408 additions and 17 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ class Storage:
)
prefix = f'{index + 1} - ' if index >= 0 else ''
return prefix + configuration.itemRemark
return prefix + profile.itemRemark
except Exception:
# Any non-exit exceptions
+7 -2
View File
@@ -38,13 +38,18 @@ class UserTUNSettings(Mixins.CleanupOnExit, StorageBackend):
def restore():
"""Restore the user TUN settings."""
try:
return UJSONEncoder.decode(
data = UJSONEncoder.decode(
PyBase64Encoder.decode(AppSettings.get('CustomTUNSettings'))
)
if isinstance(data, dict):
return data
except Exception:
# Any non-exit exceptions
return {}
pass
return {}
self._data = restore()