Spaces:
Running
Running
Sync DemoService c98fcc7b9b8bb1b2184dd084eadce9dd260a861e
Browse files
docs/WEAR_CONNECTION_V37.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ๋ชจ๋ฐ์ผ v37: ์ฐ๊ฒฐ ์ํ ๊ณ ์ฐฉ ์์
|
| 2 |
+
|
| 3 |
+
## ์์ธ๊ณผ ๋ณ๊ฒฝ
|
| 4 |
+
|
| 5 |
+
๊ธฐ์กด ๋ชจ๋ฐ์ผ์ Data Layer ๋
ธ๋๊ฐ ํ๋๋ผ๋ ์์ผ๋ฉด `connected=true`๋ก ๋ง๋ค์๋ค. ์ฑ์ ping ์๋ต ์ฌ๋ถ์ ๋ฌด๊ดํ๊ณ , capability/์ด์ ready ์บ์๋ฅผ ํ์ฌ ์ฐ๊ฒฐ์ ๊ทผ๊ฑฐ๋ก ์ฌ์ฉํ ์ ์์๋ค. ์น์ 5์ด ์กฐํ๋ง ์์๊ณ ํด๋ํฐ ์ฐ๊ฒฐ ๋ณํ ์ด๋ฒคํธ๊ฐ ์น ์ํ๋ฅผ ๋ฌดํจํํ์ง ์์๋ค.
|
| 6 |
+
|
| 7 |
+
- `connected`๋ ์ด๋ฒ ์กฐํ๋ฅผ ์์ํ ์ดํ ๋ฐ์ ์์น ready ์๋ต์ผ๋ก๋ง ํ์ ํ๋ค. ์ ์ฅ๋ 15์ด ready TTL์ ์ ๊ฑฐํ๋ค. capability๋ ์ค์น ์ฌ๋ถ์ ๋ณด์กฐ ์ ๋ณด์ด๋ฉฐ ์ฐ๊ฒฐ ์ฆ๋ช
์ด ์๋๋ค.
|
| 8 |
+
- 2์ด probe ํ ๋
ธ๋ ๋ชฉ๋ก์ ๋ค์ ์กฐํํ์ฌ ์์ ์์ ์ ๋
ธ๋ ๋ชฉ๋ก์ ๊ทธ๋๋ก ์ฌ์ฌ์ฉํ์ง ์๋๋ค. ๋ฌด์๋ต ๋
ธ๋๋ '์์น ์๋ต ํ์ธ ์ ๋จ'์ผ๋ก ํ์ํ๋ค.
|
| 9 |
+
- Bluetooth ์ ์ ๋ณํ, OS๊ฐ ์ ๋ฌํ ACL ๋ณํ, Wear capability/peer ๋ณํ ์์ ์ ์ฆ์ ๊ธฐ์กด ํ์๋ฅผ ๋ฌดํจํํ๊ณ ์กฐํํ๋ค. Bluetooth ACL ์ด๋ฒคํธ๋ OS ๊ถํ/์ ๋ฌ ์ ์ฑ
์ ๋ฐ๋ผ ์ค์ง ์์ ์ ์์ด capability ์ด๋ฒคํธ์ ์ฃผ๊ธฐ ์กฐํ๋ฅผ ๋ณํํ๋ค.
|
| 10 |
+
- ์กฐํ ๋์ค ์ฐ๊ฒฐ ๋ณํ๊ฐ ์๊ธฐ๋ฉด generation์ด ๋ฌ๋ผ์ง ์ด์ ์กฐํ ๊ฒฐ๊ณผ๋ฅผ ๋ฒ๋ฆฌ๊ณ ๋ค์ ์กฐํํ๋ค.
|
| 11 |
+
- ํ๋ฉด์ด ๋ณด์ผ ๋ 3์ด ํด๋ง, 8์ด ์๋ต ๋ง๋ฃ. ๋ธ๋ฆฌ์ง ์ฌ์ฐ๊ฒฐ ์์๋ ๊ธฐ์กด ์ํ๋ฅผ ์ฌํ์ธํ๋ค. ์น์์๋ ์ด์ ์๊ฐ์ ์ํ ํจํท์ด ์ต์ ์ํ๋ฅผ ๋ฎ์ด์ฐ์ง ๋ชปํ๊ฒ ํ๋ค.
|
| 12 |
+
- Bluetooth ์ ์์ด ๊บผ์ก๋ค๋ ์ด๋ฒคํธ์ ์ค์ ์์น ์ฑ ํต์ ์ ๋ถ๋ฆฌํ๋ค. Wi-Fi ๊ฒฝ์ fresh ์๋ต์ด ์์ผ๋ฉด '์์น ์ฐ๊ฒฐ๋จ ยท Bluetooth ๊บผ์ง'์ ํ์ํ ์ ์๋ค.
|
| 13 |
+
|
| 14 |
+
OS ์ด๋ฒคํธ๋ฅผ ๋ฐ์ ๋ค UI๋ฅผ ์ฆ์ ๋ฌดํจํํ๋ ๊ฒ์ด๋ฉฐ, ๋ฌผ๋ฆฌ์ ์ฐ๊ฒฐ ๋ณํ ๊ฐ์ง์ ์ค์ ์ฌํ์ธ๊น์ง 0ms๋ผ๊ณ ๋ณด์ฅํ๋ ๊ฒ์ ์๋๋ค. ์ด๋ฒคํธ๊ฐ ๋๋ฝ๋๋ฉด ์ฃผ๊ธฐ ์กฐํ์ ์๋ต ๋ง๋ฃ๊ฐ ๋ณด์ํ๋ค. ๋ฌด์๋ต์ ์ฐ๊ฒฐ ํด์ ๋ฅผ ํ์ ํ ๊ฒ๊ณผ ๊ตฌ๋ถํ๋ค.
|
| 15 |
+
|
| 16 |
+
๊ณต์ API ์ฐธ๊ณ : [WearableListenerService](https://developers.google.com/android/reference/com/google/android/gms/wearable/WearableListenerService), [BluetoothAdapter.ACTION_STATE_CHANGED](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#ACTION_STATE_CHANGED).
|
| 17 |
+
|
| 18 |
+
## ์ค์น ํ์ผ
|
| 19 |
+
|
| 20 |
+
- DemoService: `releases/android/RunTheShape-v37-debug.apk`
|
| 21 |
+
- package: `space.hf.tkadkghdlf_cd.twa`, versionCode/versionName 37
|
| 22 |
+
- ์ธ์ฆ์ SHA-256: `814132ac537a68557268187d92d2c3416d1e9fc0f4f7236d54ce050a179ba54c`
|
| 23 |
+
- APK SHA-256: `75ed9961ca89affdff81b4a435d04211ab414536eaede4506a48992102c4047d`
|
| 24 |
+
- ๋ชจ๋ฐ์ผ v35/v36์ ๋์ผ ์๋ช
์ด๋ฉฐ ์
๋ฐ์ดํธ ๊ฐ๋ฅ. v36 ๋ฌ๋ ๋๊ธฐํ ์์ ํฌํจ.
|
| 25 |
+
- ์ด๋ฒ ์์ ์ ์์น ์์ค/ํ์ ์ค์ /๊ธฐ๊ธฐ ์ค์น๋ฅผ ๋ณ๊ฒฝํ์ง ์๋๋ค. ์ฐ๊ฒฐ ํ์ธ์ ๊ธฐ์กด ping/ready ๊ท์ฝ๊ณผ ํธํ๋๋ค. ์์ ๋ฌ๋ ๋๊ธฐํ ๊ฐ์ ์๋ ์์น v3๊ฐ ๋ณ๋๋ก ํ์ํ๋ค.
|
| 26 |
+
|
| 27 |
+
## ๊ฒ์ฆ
|
| 28 |
+
|
| 29 |
+
๋ชจ๋ฐ์ผ assembleDebug ๋ฐ apksigner ๊ฒ์ฆ, TypeScript ๊ฒ์ฌ, ์น ํ๋ก๋์
๋น๋, nativeWearBootstrap/twaNativeContract/nativeAppVisibility/wearConnectionState ํ๊ท ํ
์คํธ ํต๊ณผ. ํ
์คํธ์๋ ์บ์ ๋ง๋ฃ, ๋ณํ ์ค ์กฐํ ๋ฌดํจํ์ ์์ค ๊ณ์ฝ, ๋ฆ์ ์ฐ๊ฒฐ ์๋ต ๋ฌด์, Bluetooth off + ์ ํจ ์๋ต ๊ตฌ๋ถ์ด ํฌํจ๋๋ค. ์ค์ Bluetooth ๋๊ธฐ/์ฌ์ฐ๊ฒฐ ํ
์คํธ๋ ์ฌ์ฉ์ ํ์ธ ์์ ์ด๋ค.
|
| 30 |
+
|
| 31 |
+
์ต์ ์น ๋ฐฐํฌ์ ๋ชจ๋ฐ์ผ v37 ์ค์น ํ:
|
| 32 |
+
|
| 33 |
+
1. ์ฑ ๋ก๋น์์ ์ฐ๊ฒฐ ํ์ ํ์ธ.
|
| 34 |
+
2. Bluetooth ๋๊ธฐ: ๊ธฐ์กด ํ์๊ฐ ์ฌํ์ธ์ผ๋ก ์ ํ๋๋์ง ํ์ธ. Wi-Fi๋ก ์๋ตํ๋ฉด ์ฐ๊ฒฐ ํ์ ์ ์ง๊ฐ ์ ์์ด๋ฉฐ Bluetooth ๊บผ์ง์ ํจ๊ป ํ์ํ๋ค.
|
| 35 |
+
3. ์์น์ Bluetooth/Wi-Fi๋ฅผ ๋ชจ๋ ๋๊ฑฐ๋ ์์น ์ ์์ ๊บผ ์ค์ ํต์ ์ฐจ๋จ: ์ฐ๊ฒฐ๋จ์ด ์ ์ง๋์ง ์๊ณ ๋ฌด์๋ต/์ฐ๊ฒฐ ์ ๋จ์ผ๋ก ๋ฐ๋์ด์ผ ํ๋ค.
|
| 36 |
+
4. ํต์ ๋ณต์: ์๋ก๊ณ ์นจ ์์ด ์๋ก์ด ์๋ต์ผ๋ก ์ฐ๊ฒฐ๋จ ํ์ ํ๋ณต.
|
| 37 |
+
5. ํ๋ฉด์ ์จ๊ฒผ๋ค๊ฐ ๋์์ค๊ฑฐ๋ ์ฑ ์ฌ์คํ: ์ค๋๋ ํ์๊ฐ ๊ณ์ ๋จ์ง ์๋์ง ํ์ธ.
|
| 38 |
+
|
| 39 |
+
Git ํธ์๋ ์น ๋ฐฐํฌ ์ฑ๊ณต ๋๋ APK ๊ธฐ๊ธฐ ์ค์น๋ฅผ ์๋ฏธํ์ง ์๋๋ค.
|
main/app/_components/WearableConnectionStatus.tsx
CHANGED
|
@@ -30,7 +30,7 @@ export default function WearableConnectionStatus() {
|
|
| 30 |
window.addEventListener("focus", refresh);
|
| 31 |
document.addEventListener("visibilitychange", visible);
|
| 32 |
refresh();
|
| 33 |
-
const retry = window.setInterval(poll,
|
| 34 |
const clock = window.setInterval(() => {
|
| 35 |
if (document.visibilityState === "visible") setNow(Date.now());
|
| 36 |
}, 1000);
|
|
@@ -62,8 +62,8 @@ export default function WearableConnectionStatus() {
|
|
| 62 |
permission: ["์์น ํ์ธ ๊ถํ ํ์", "ํด๋ํฐ ์ค์ ์์ Run The Shape์ ๊ทผ์ฒ ๊ธฐ๊ธฐ ๊ถํ์ ํ์ฉํด ์ฃผ์ธ์."],
|
| 63 |
"bluetooth-off": ["Bluetooth ๊บผ์ง", "ํด๋ํฐ์ Bluetooth๋ฅผ ์ผ๊ณ ๋ค์ ํ์ธํด ์ฃผ์ธ์."],
|
| 64 |
disconnected: ["์์น ์ฐ๊ฒฐ ์ ๋จ", "ํด๋ํฐ ์ฑ์์ ์ฐ๊ฒฐ๋ ์์น๋ฅผ ์ฐพ์ง ๋ชปํ์ต๋๋ค. Bluetooth์ ์์น ์ฑ ์ฐ๊ฒฐ์ ํ์ธํด ์ฃผ์ธ์."],
|
| 65 |
-
paired: ["์์น
|
| 66 |
-
connected: ["์์น ์ฐ๊ฒฐ๋จ", `${names || "Wear OS ์์น"}
|
| 67 |
};
|
| 68 |
const [title, detail] = labels[state];
|
| 69 |
|
|
|
|
| 30 |
window.addEventListener("focus", refresh);
|
| 31 |
document.addEventListener("visibilitychange", visible);
|
| 32 |
refresh();
|
| 33 |
+
const retry = window.setInterval(poll, 3000);
|
| 34 |
const clock = window.setInterval(() => {
|
| 35 |
if (document.visibilityState === "visible") setNow(Date.now());
|
| 36 |
}, 1000);
|
|
|
|
| 62 |
permission: ["์์น ํ์ธ ๊ถํ ํ์", "ํด๋ํฐ ์ค์ ์์ Run The Shape์ ๊ทผ์ฒ ๊ธฐ๊ธฐ ๊ถํ์ ํ์ฉํด ์ฃผ์ธ์."],
|
| 63 |
"bluetooth-off": ["Bluetooth ๊บผ์ง", "ํด๋ํฐ์ Bluetooth๋ฅผ ์ผ๊ณ ๋ค์ ํ์ธํด ์ฃผ์ธ์."],
|
| 64 |
disconnected: ["์์น ์ฐ๊ฒฐ ์ ๋จ", "ํด๋ํฐ ์ฑ์์ ์ฐ๊ฒฐ๋ ์์น๋ฅผ ์ฐพ์ง ๋ชปํ์ต๋๋ค. Bluetooth์ ์์น ์ฑ ์ฐ๊ฒฐ์ ํ์ธํด ์ฃผ์ธ์."],
|
| 65 |
+
paired: ["์์น ์๋ต ํ์ธ ์ ๋จ", `${names || "๋ฑ๋ก๋ ์์น"}์ ์ต์ ์ฑ ์๋ต์ ๋ฐ์ง ๋ชปํ์ต๋๋ค. ์ฐ๊ฒฐ ์ํ์ ์์น ์ฑ์ ํ์ธํด ์ฃผ์ธ์.`],
|
| 66 |
+
connected: [status?.bluetoothEnabled === false ? "์์น ์ฐ๊ฒฐ๋จ ยท Bluetooth ๊บผ์ง" : "์์น ์ฐ๊ฒฐ๋จ", `${names || "Wear OS ์์น"}์ ์ต์ ์๋ต์ ํ์ธํ์ต๋๋ค. Bluetooth๊ฐ ๊บผ์ ธ๋ Wi-Fi ๊ฒฝ์ ํต์ ์ ์ ์ง๋ ์ ์์ต๋๋ค.`],
|
| 67 |
};
|
| 68 |
const [title, detail] = labels[state];
|
| 69 |
|
main/app/_utils/nativeWearBridge.ts
CHANGED
|
@@ -346,6 +346,8 @@ export const sendNativeWearControl = (
|
|
| 346 |
};
|
| 347 |
|
| 348 |
const storeNativeWearDeviceStatus = (status: NativeWearDeviceStatus) => {
|
|
|
|
|
|
|
| 349 |
window.localStorage.setItem(
|
| 350 |
NATIVE_WEAR_DEVICE_STATUS_STORAGE_KEY,
|
| 351 |
JSON.stringify(status),
|
|
|
|
| 346 |
};
|
| 347 |
|
| 348 |
const storeNativeWearDeviceStatus = (status: NativeWearDeviceStatus) => {
|
| 349 |
+
const previous = readNativeWearDeviceStatus();
|
| 350 |
+
if (previous && previous.updatedAt > status.updatedAt) return;
|
| 351 |
window.localStorage.setItem(
|
| 352 |
NATIVE_WEAR_DEVICE_STATUS_STORAGE_KEY,
|
| 353 |
JSON.stringify(status),
|
main/app/_utils/wearConnectionState.ts
CHANGED
|
@@ -2,9 +2,10 @@ import type { NativeWearDeviceStatus } from "./nativeWearBridge";
|
|
| 2 |
|
| 3 |
export function wearConnectionState(status: NativeWearDeviceStatus | null, now: number, requestedAt: number) {
|
| 4 |
const age = status ? now - status.updatedAt : Infinity;
|
| 5 |
-
if (!status || !Number.isFinite(age) || status.updatedAt <= 0 || age < 0 || age >
|
| 6 |
return now - requestedAt < 10000 ? "checking" : "unavailable";
|
| 7 |
}
|
|
|
|
| 8 |
if (status.queryError) return "query-error";
|
| 9 |
if (status.connected) return "connected";
|
| 10 |
if (status.permissionGranted === false) return "permission";
|
|
|
|
| 2 |
|
| 3 |
export function wearConnectionState(status: NativeWearDeviceStatus | null, now: number, requestedAt: number) {
|
| 4 |
const age = status ? now - status.updatedAt : Infinity;
|
| 5 |
+
if (!status || !Number.isFinite(age) || status.updatedAt <= 0 || age < 0 || age > 8000) {
|
| 6 |
return now - requestedAt < 10000 ? "checking" : "unavailable";
|
| 7 |
}
|
| 8 |
+
if (status.queryError === "checking") return "checking";
|
| 9 |
if (status.queryError) return "query-error";
|
| 10 |
if (status.connected) return "connected";
|
| 11 |
if (status.permissionGranted === false) return "permission";
|
main/tests/nativeWearBootstrap.cjs
CHANGED
|
@@ -64,3 +64,11 @@ assert(sent.some(message => message.type === 'tranimal.main.run-state'
|
|
| 64 |
emit('android-app://untrusted.example', '', [port]);
|
| 65 |
assert.equal(window.__tranimalNativeWearPort, latePort);
|
| 66 |
console.log('PASS: empty Android channel message before/after hydration, origin rejection, handoff, live updates, no run-command replay');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
emit('android-app://untrusted.example', '', [port]);
|
| 65 |
assert.equal(window.__tranimalNativeWearPort, latePort);
|
| 66 |
console.log('PASS: empty Android channel message before/after hydration, origin rejection, handoff, live updates, no run-command replay');
|
| 67 |
+
const disconnectedAt = Date.now() + 100;
|
| 68 |
+
latePort.onmessage({ data: { type: 'wearDevices.status', payload: {
|
| 69 |
+
source: 'android', connected: false, devices: [], updatedAt: disconnectedAt,
|
| 70 |
+
} } });
|
| 71 |
+
latePort.onmessage({ data: { type: 'wearDevices.status', payload: {
|
| 72 |
+
source: 'android', connected: true, devices: [], updatedAt: disconnectedAt - 1,
|
| 73 |
+
} } });
|
| 74 |
+
assert.equal(context.exports.readNativeWearDeviceStatus().connected, false, 'late cached response must not undo disconnect');
|
main/tests/twaNativeContract.cjs
CHANGED
|
@@ -20,4 +20,12 @@ assert.match(listener, /WatchControlInbox.enqueue/);
|
|
| 20 |
assert.match(inbox, /TTL_MS = 120_000L/);
|
| 21 |
assert.match(inbox, /items.length\(\) >= 32/);
|
| 22 |
assert.match(activity, /"tranimal.main.run-state".equals\(type\)/);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
console.log('PASS: native status dispatch, timeout/error, control acknowledgement and bounded inbox source contracts');
|
|
|
|
| 20 |
assert.match(inbox, /TTL_MS = 120_000L/);
|
| 21 |
assert.match(inbox, /items.length\(\) >= 32/);
|
| 22 |
assert.match(activity, /"tranimal.main.run-state".equals\(type\)/);
|
| 23 |
+
assert.match(activity, /BluetoothAdapter.ACTION_STATE_CHANGED/);
|
| 24 |
+
assert.match(activity, /BluetoothDevice.ACTION_ACL_DISCONNECTED/);
|
| 25 |
+
assert.match(activity, /generation == wearStatusGeneration/);
|
| 26 |
+
assert.match(activity, /status.put\("connected", responsive\)/);
|
| 27 |
+
assert.doesNotMatch(activity, /status.put\("connected", !watches.isEmpty\(\)\)/);
|
| 28 |
+
assert.match(manager, /readyAt >= probeStartedAt/);
|
| 29 |
+
assert.doesNotMatch(manager, /READY_TTL_MS/);
|
| 30 |
+
assert.match(listener, /onPeerDisconnected/);
|
| 31 |
console.log('PASS: native status dispatch, timeout/error, control acknowledgement and bounded inbox source contracts');
|
main/tests/wearConnectionState.cjs
CHANGED
|
@@ -13,6 +13,10 @@ assert.equal(state(null, now, now), 'checking');
|
|
| 13 |
assert.equal(state(null, now, now - 10000), 'unavailable');
|
| 14 |
assert.equal(state(fresh, now, 0), 'connected');
|
| 15 |
assert.equal(state(fresh, now + 21000, 0), 'unavailable');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
assert.equal(state({ ...fresh, updatedAt: 0 }, now, 0), 'unavailable');
|
| 17 |
assert.equal(state({ ...fresh, updatedAt: NaN }, now, 0), 'unavailable');
|
| 18 |
assert.equal(state({ ...fresh, updatedAt: now + 1000 }, now, 0), 'unavailable');
|
|
@@ -20,6 +24,7 @@ assert.equal(state({ ...fresh, connected: false }, now, 0), 'disconnected');
|
|
| 20 |
assert.equal(state({ ...fresh, connected: false, devices: [{}] }, now, 0), 'paired');
|
| 21 |
assert.equal(state({ ...fresh, connected: false, permissionGranted: false }, now, 0), 'permission');
|
| 22 |
assert.equal(state({ ...fresh, connected: false, bluetoothEnabled: false }, now, 0), 'bluetooth-off');
|
|
|
|
| 23 |
// Fresh replies maintain connected state well beyond the former eight-second polling window.
|
| 24 |
for (let elapsed = 0; elapsed <= 60000; elapsed += 5000) {
|
| 25 |
assert.equal(state({ ...fresh, updatedAt: now + elapsed }, now + elapsed, now), 'connected');
|
|
|
|
| 13 |
assert.equal(state(null, now, now - 10000), 'unavailable');
|
| 14 |
assert.equal(state(fresh, now, 0), 'connected');
|
| 15 |
assert.equal(state(fresh, now + 21000, 0), 'unavailable');
|
| 16 |
+
assert.equal(state(fresh, now + 8001, 0), 'unavailable', 'old connected reply must expire');
|
| 17 |
+
assert.equal(state({ ...fresh, connected: false, queryError: 'checking' }, now, 0), 'checking');
|
| 18 |
+
assert.equal(state({ ...fresh, queryError: 'checking' }, now, 0), 'checking', 'invalidation beats cached connected flag');
|
| 19 |
+
assert.equal(state({ ...fresh, connected: false, devices: [{ connectionState: 'paired' }] }, now, 0), 'paired');
|
| 20 |
assert.equal(state({ ...fresh, updatedAt: 0 }, now, 0), 'unavailable');
|
| 21 |
assert.equal(state({ ...fresh, updatedAt: NaN }, now, 0), 'unavailable');
|
| 22 |
assert.equal(state({ ...fresh, updatedAt: now + 1000 }, now, 0), 'unavailable');
|
|
|
|
| 24 |
assert.equal(state({ ...fresh, connected: false, devices: [{}] }, now, 0), 'paired');
|
| 25 |
assert.equal(state({ ...fresh, connected: false, permissionGranted: false }, now, 0), 'permission');
|
| 26 |
assert.equal(state({ ...fresh, connected: false, bluetoothEnabled: false }, now, 0), 'bluetooth-off');
|
| 27 |
+
assert.equal(state({ ...fresh, bluetoothEnabled: false }, now, 0), 'connected', 'fresh Wi-Fi response is still connected');
|
| 28 |
// Fresh replies maintain connected state well beyond the former eight-second polling window.
|
| 29 |
for (let elapsed = 0; elapsed <= 60000; elapsed += 5000) {
|
| 30 |
assert.equal(state({ ...fresh, updatedAt: now + elapsed }, now + elapsed, now), 'connected');
|