feat(native): the app needs TREK 5.1.3 on the server and checks a remembered one once after the update

The fixes that keep the app's sign-in in the app live in the server's UI,
so an updated app on a 5.1.2 server still ended in the browser. The server now
reports nativeApi 2 and the app refuses anything below it, naming 5.1.3.

A server the app remembers from before is not loaded unchecked: the first
launch after the update shows the address screen filled in with it, says why
and checks it right away. A server that is new enough loads again with its
session; an older one gets the update hint.
This commit is contained in:
Maurice
2026-11-10 09:17:26 +01:00
parent b124e1bc9c
commit 5cbe4e2fa3
39 changed files with 217 additions and 53 deletions
@@ -69,7 +69,10 @@ export class FeaturesController {
// The version of what the apps rely on from the server (the hand-off
// routes, the shell bridge in the served UI). Raised only for a change an
// older app cannot follow; the app refuses a server below its minimum.
nativeApi: 1,
// 2 (5.1.3): the browser sign-in starts under /api, past an older TREK's
// service worker, and the hand-off page signs in by itself. Apps from then
// on refuse a server below it, so its users stop landing in the browser.
nativeApi: 2,
// The other way round: the oldest app binary this server's UI works with,
// as the shell API the app reports (TrekShell.getCapabilities). An app
// below it is asked to update instead of running native calls it lacks.
@@ -37,7 +37,7 @@ describe('FeaturesController (GET /api/health/features)', () => {
aiParsing: true,
aiAssistant: true,
nativeApp: true,
nativeApi: 1,
nativeApi: 2,
minNativeShellApi: 1,
});
});
@@ -49,7 +49,7 @@ describe('FeaturesController (GET /api/health/features)', () => {
aiParsing: false,
aiAssistant: false,
nativeApp: true,
nativeApi: 1,
nativeApi: 2,
minNativeShellApi: 1,
});
});
@@ -60,7 +60,7 @@ describe('FeaturesController (GET /api/health/features)', () => {
aiParsing: false,
aiAssistant: false,
nativeApp: true,
nativeApi: 1,
nativeApi: 2,
minNativeShellApi: 1,
});
expect(await make(false, true).controller.features()).toEqual({
@@ -68,7 +68,7 @@ describe('FeaturesController (GET /api/health/features)', () => {
aiParsing: true,
aiAssistant: true,
nativeApp: true,
nativeApi: 1,
nativeApi: 2,
minNativeShellApi: 1,
});
});
@@ -94,7 +94,7 @@ describe('FeaturesController (GET /api/health/features)', () => {
it('FEAT-014: tells the native apps it speaks their sign-in hand-off, and at which version', async () => {
const features = await make(false, false).controller.features();
expect(features.nativeApp).toBe(true);
expect(features.nativeApi).toBe(1);
expect(features.nativeApi).toBe(2);
// And which app binaries its UI still works with.
expect(features.minNativeShellApi).toBe(1);
});