feat(app): phone onboarding (server, then password) kept across launches; a known server opens straight into the app; a refused session asks for the password

This commit is contained in:
2026-10-23 23:52:34 +01:00
parent 57504b73d4
commit 636115bb22
12 changed files with 650 additions and 33 deletions
+18 -22
View File
@@ -26,29 +26,25 @@ class _TestSettingsStore implements SettingsStore {
void main() {
const nativeBase = 'http://127.0.0.1:8096/';
test(
'uses saved endpoint natively only when build configuration is blank',
() async {
final store = _TestSettingsStore('wss://saved.example.test');
final saved = await resolveLaunchServer(
base: Uri.parse(nativeBase),
configured: '',
web: false,
settingsStore: store,
);
expect(saved.uri, Uri.parse('wss://saved.example.test/connect'));
expect(store.loads, 1);
test('a saved endpoint wins over the build default on a phone', () async {
final store = _TestSettingsStore('wss://saved.example.test');
final saved = await resolveLaunchServer(
base: Uri.parse(nativeBase),
configured: 'ws://build.example.test',
web: false,
settingsStore: store,
);
expect(saved.uri, Uri.parse('wss://saved.example.test/connect'));
final configured = await resolveLaunchServer(
base: Uri.parse(nativeBase),
configured: 'ws://build.example.test',
web: false,
settingsStore: store,
);
expect(configured.uri, Uri.parse('ws://build.example.test/connect'));
expect(store.loads, 1);
},
);
// Nothing saved yet: the build default stands (and pre-fills onboarding).
final fallback = await resolveLaunchServer(
base: Uri.parse(nativeBase),
configured: 'ws://build.example.test',
web: false,
settingsStore: _TestSettingsStore(''),
);
expect(fallback.uri, Uri.parse('ws://build.example.test/connect'));
});
test(
'blank or failed settings load leaves native configuration required',