Idle exit starts however the app was opened (0.1.2)
On a real G2 with build 0.1.1, a voice launch with nothing touched never left the glasses: no glassesMenu launch source reached the app, so the countdown was never armed. After one swipe it left as designed. The countdown now runs however the session was opened. The launch source is kept for Diagnostics only. Setting up on the phone stays protected: nothing leaves while unpaired, and a touch on the phone page holds the app open for the grace period. Dan approved the change after the trial. Also records the 0.1.1 trial, Dan's keep/change decisions (contract section F) and the 0.1.1 upload. Version 0.1.2. Not reviewed, not uploaded. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -202,13 +202,14 @@ describe('the one-shot launch source is not lost during start-up', () => {
|
||||
expect(host.maxInFlight).toBe(1);
|
||||
});
|
||||
|
||||
it('control: with no launch source and no gesture, the same start-up does not leave', async () => {
|
||||
it('with no launch source and no gesture at all, the same start-up still leaves, once', async () => {
|
||||
await pairedHost();
|
||||
controller = makeController();
|
||||
await controller.start();
|
||||
await until('ready', () => snapshot.state.phase === 'ready');
|
||||
await quiet(500);
|
||||
expect(host.exitCalls).toEqual([]);
|
||||
await until('left the glasses', () => logged('left the glasses') === 1, 2000);
|
||||
await quiet(400);
|
||||
expect(host.exitCalls).toEqual([0]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -313,30 +314,65 @@ describe('default idle times with the production adapter (fake clock)', () => {
|
||||
await expectOneExitAtThirtySeconds();
|
||||
});
|
||||
|
||||
it('glassesMenu pushed AFTER the controller subscribed: one exit, 30 s later', async () => {
|
||||
it('glassesMenu pushed AFTER the controller subscribed: still one exit, 30 s after Ready', async () => {
|
||||
await pairedHost();
|
||||
fakeClock();
|
||||
controller = defaults();
|
||||
await controller.start();
|
||||
await vi.advanceTimersByTimeAsync(5 * 60_000);
|
||||
expect(host.exitCalls).toEqual([]); // nothing has said the glasses are in use
|
||||
host.pushLaunchSource('glassesMenu');
|
||||
await vi.advanceTimersByTimeAsync(10_000);
|
||||
host.pushLaunchSource('glassesMenu'); // arrives late: it must not restart or double the countdown
|
||||
await vi.advanceTimersByTimeAsync(19_900);
|
||||
expect(host.exitCalls).toEqual([]);
|
||||
await vi.advanceTimersByTimeAsync(200);
|
||||
expect(host.exitCalls).toEqual([0]);
|
||||
await vi.advanceTimersByTimeAsync(10 * 60_000);
|
||||
expect(host.exitCalls).toEqual([0]);
|
||||
});
|
||||
|
||||
it('NO launch source is ever pushed (seen on a real G2 voice launch): one exit, 30 s after Ready', async () => {
|
||||
await pairedHost();
|
||||
fakeClock();
|
||||
controller = defaults();
|
||||
await controller.start();
|
||||
expect(snapshot.launchSource).toBe('unknown');
|
||||
await expectOneExitAtThirtySeconds();
|
||||
});
|
||||
|
||||
it('appMenu pushed early does not arm it; the first glasses gesture does', async () => {
|
||||
it('appMenu pushed early: opened from the phone app, it leaves the same way', async () => {
|
||||
await pairedHost();
|
||||
fakeClock();
|
||||
controller = defaults();
|
||||
host.pushLaunchSource('appMenu');
|
||||
await controller.start();
|
||||
expect(snapshot.launchSource).toBe('appMenu');
|
||||
await vi.advanceTimersByTimeAsync(10 * 60_000);
|
||||
expect(host.exitCalls).toEqual([]);
|
||||
host.swipeDown();
|
||||
await expectOneExitAtThirtySeconds();
|
||||
});
|
||||
|
||||
it('opened and then the phone page is touched: the full two-minute grace, then 30 s', async () => {
|
||||
await pairedHost();
|
||||
fakeClock();
|
||||
controller = defaults();
|
||||
await controller.start();
|
||||
await vi.advanceTimersByTimeAsync(5_000);
|
||||
controller.notePhoneActivity();
|
||||
await vi.advanceTimersByTimeAsync(149_500);
|
||||
expect(host.exitCalls).toEqual([]);
|
||||
await vi.advanceTimersByTimeAsync(1_000);
|
||||
expect(host.exitCalls).toEqual([0]);
|
||||
});
|
||||
|
||||
it('never paired: nothing leaves, however long it is left', async () => {
|
||||
host = new FakeEvenHost();
|
||||
fakeClock();
|
||||
controller = defaults();
|
||||
host.pushLaunchSource('glassesMenu');
|
||||
await controller.start();
|
||||
expect(snapshot.state.phase).toBe('unpaired');
|
||||
host.swipeDown();
|
||||
await vi.advanceTimersByTimeAsync(30 * 60_000);
|
||||
expect(host.exitCalls).toEqual([]);
|
||||
});
|
||||
|
||||
it('unsubscribing is preserved: a stopped controller no longer hears the launch source', async () => {
|
||||
await pairedHost();
|
||||
fakeClock();
|
||||
|
||||
Reference in New Issue
Block a user