Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a78fdeae66 | ||
|
|
b17ff5554e | ||
|
|
43b63e8eb9 | ||
|
|
df36e92500 |
@@ -23,7 +23,7 @@ export function EquipmentSettings({device,model,hosts,telemetry,vehicles,profile
|
|||||||
useEffect(()=>{if(!networkPending)return;let active=true;let timer:ReturnType<typeof setTimeout>;async function poll(){try{const value=await equipmentRequest<{items:IndependentDevice[]}>('/instances');const current=value.items.find(d=>d.id===device.id);if(active&¤t)onObserved(current);}catch{/* Keep the pending operation visible; the VPS owns its bounded expiry. */}finally{if(active)timer=setTimeout(()=>void poll(),3000);}}timer=setTimeout(()=>void poll(),3000);return()=>{active=false;clearTimeout(timer);};},[device.id,networkPending,onObserved]);
|
useEffect(()=>{if(!networkPending)return;let active=true;let timer:ReturnType<typeof setTimeout>;async function poll(){try{const value=await equipmentRequest<{items:IndependentDevice[]}>('/instances');const current=value.items.find(d=>d.id===device.id);if(active&¤t)onObserved(current);}catch{/* Keep the pending operation visible; the VPS owns its bounded expiry. */}finally{if(active)timer=setTimeout(()=>void poll(),3000);}}timer=setTimeout(()=>void poll(),3000);return()=>{active=false;clearTimeout(timer);};},[device.id,networkPending,onObserved]);
|
||||||
const observed=device.observed;
|
const observed=device.observed;
|
||||||
const secondary=observed.configuration.servers.find(s=>s.slot===2);
|
const secondary=observed.configuration.servers.find(s=>s.slot===2);
|
||||||
const fullSettings=hosts.some(h=>h.state==='paired'&&h.vehicle_ids.includes(device.vehicle_id)&&['0.1.15','0.1.16','0.1.17','0.1.18','0.1.19','0.1.20','0.1.21','0.1.22','0.1.23','0.1.24','0.1.25','0.1.26','0.1.27','0.1.28','0.1.29','0.1.30','0.1.31','0.1.32','0.1.33','0.1.34','0.1.35','0.1.36','0.1.37','0.1.38','0.1.39','0.1.40','0.1.41','0.1.42','0.1.43'].includes(h.status?.version??'')&&h.status?.tracker.host===secondary?.host&&h.status?.tracker.port===secondary?.port);
|
const fullSettings=hosts.some(h=>h.state==='paired'&&h.vehicle_ids.includes(device.vehicle_id)&&['0.1.15','0.1.16','0.1.17','0.1.18','0.1.19','0.1.20','0.1.21','0.1.22','0.1.23','0.1.24','0.1.25','0.1.26','0.1.27','0.1.28','0.1.29','0.1.30','0.1.31','0.1.32','0.1.33','0.1.34','0.1.35','0.1.36','0.1.37','0.1.38','0.1.39','0.1.40','0.1.41','0.1.42','0.1.43','0.1.44','0.1.45','0.1.46','0.2.0','0.2.1'].includes(h.status?.version??'')&&h.status?.tracker.host===secondary?.host&&h.status?.tracker.port===secondary?.port);
|
||||||
const supported=observed.supported_profile_fields??Object.keys(device.settings.parameters);
|
const supported=observed.supported_profile_fields??Object.keys(device.settings.parameters);
|
||||||
const fields=model.fields.filter(f=>supported.includes(f.key));
|
const fields=model.fields.filter(f=>supported.includes(f.key));
|
||||||
const validation=policyError(settings,fields)||(selectSim&&settings.connectivity.strategy==='sim'&&!cellularSimCurrent(telemetry,settings.connectivity.sim_slot??1)?'Ожидаем свежие данные выбранной SIM перед отправкой настроек.':'');
|
const validation=policyError(settings,fields)||(selectSim&&settings.connectivity.strategy==='sim'&&!cellularSimCurrent(telemetry,settings.connectivity.sim_slot??1)?'Ожидаем свежие данные выбранной SIM перед отправкой настроек.':'');
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ def apply(hosts, identifier, revision):
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
)
|
)
|
||||||
or time.time() - host["last_sync_at"] > 30
|
or time.time() - host["last_sync_at"] > 30
|
||||||
):
|
):
|
||||||
|
|||||||
@@ -78,6 +78,11 @@ def enqueue(hosts, identifier, request_id, preset_id):
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
}:
|
}:
|
||||||
raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.")
|
raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.")
|
||||||
count = db.execute(
|
count = db.execute(
|
||||||
|
|||||||
@@ -249,6 +249,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
automatic_access = None
|
automatic_access = None
|
||||||
@@ -325,6 +330,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
}:
|
}:
|
||||||
raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.")
|
raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.")
|
||||||
if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in {
|
if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in {
|
||||||
@@ -351,6 +361,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
}:
|
}:
|
||||||
raise EquipmentError("Для смены SIM установите актуальный VPS Host.")
|
raise EquipmentError("Для смены SIM установите актуальный VPS Host.")
|
||||||
else:
|
else:
|
||||||
@@ -402,6 +417,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
),
|
),
|
||||||
"request-position": (
|
"request-position": (
|
||||||
"0.1.8",
|
"0.1.8",
|
||||||
@@ -443,6 +463,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
),
|
),
|
||||||
"pulse-output": (
|
"pulse-output": (
|
||||||
"0.1.9",
|
"0.1.9",
|
||||||
@@ -483,6 +508,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
),
|
),
|
||||||
"set-output": (
|
"set-output": (
|
||||||
"0.1.10",
|
"0.1.10",
|
||||||
@@ -522,6 +552,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
if source.get("status", {}).get("version") not in versions[command["kind"]]:
|
if source.get("status", {}).get("version") not in versions[command["kind"]]:
|
||||||
@@ -571,6 +606,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
)
|
)
|
||||||
for h in (source, target)
|
for h in (source, target)
|
||||||
):
|
):
|
||||||
@@ -658,6 +698,11 @@ def start(
|
|||||||
"0.1.44",
|
"0.1.44",
|
||||||
"0.1.45",
|
"0.1.45",
|
||||||
"0.1.46",
|
"0.1.46",
|
||||||
|
"0.2.0",
|
||||||
|
"0.2.1",
|
||||||
|
"0.2.2",
|
||||||
|
"0.2.3",
|
||||||
|
"0.2.4",
|
||||||
}
|
}
|
||||||
if durable_delivery:
|
if durable_delivery:
|
||||||
lifetime = (
|
lifetime = (
|
||||||
|
|||||||
+1
-1
@@ -322,6 +322,6 @@
|
|||||||
"web_protocol.py": "f9c3eba194144e6cc839e80997917967b8075bdbc866fdbefa6929b55cd27c86"
|
"web_protocol.py": "f9c3eba194144e6cc839e80997917967b8075bdbc866fdbefa6929b55cd27c86"
|
||||||
},
|
},
|
||||||
"schema": "nodedc.arnavi-client-contract/v1",
|
"schema": "nodedc.arnavi-client-contract/v1",
|
||||||
"server_version": "0.1.46",
|
"server_version": "0.2.4",
|
||||||
"synthetic_only": true
|
"synthetic_only": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,3 +72,10 @@ def test_initial_usb_apply_accepts_current_shipped_host():
|
|||||||
host["status"]["version"] = version
|
host["status"]["version"] = version
|
||||||
assert apply(hosts, "device", 1) == {"ok": True}
|
assert apply(hosts, "device", 1) == {"ok": True}
|
||||||
hosts.equipment.apply.assert_called_once_with("device", 1)
|
hosts.equipment.apply.assert_called_once_with("device", 1)
|
||||||
|
|
||||||
|
|
||||||
|
def test_initial_apply_accepts_shared_host_without_changing_legacy_pairing():
|
||||||
|
hosts, _, host = context()
|
||||||
|
host["status"]["version"] = "0.2.4"
|
||||||
|
assert apply(hosts, "device", 1) == {"ok": True}
|
||||||
|
hosts.equipment.apply.assert_called_once_with("device", 1)
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ def sender(monkeypatch):
|
|||||||
return sent
|
return sent
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("version", ["0.1.26", "0.1.27", "0.1.28", "0.1.29", "0.1.30", "0.1.31"])
|
@pytest.mark.parametrize(
|
||||||
|
"version", ["0.1.26", "0.1.27", "0.1.28", "0.1.29", "0.1.30", "0.1.31", "0.2.0", "0.2.3", "0.2.4"]
|
||||||
|
)
|
||||||
def test_queue_survives_restart_and_idempotent_submit(ready, monkeypatch, version):
|
def test_queue_survives_restart_and_idempotent_submit(ready, monkeypatch, version):
|
||||||
equipment, hosts, row = ready
|
equipment, hosts, row = ready
|
||||||
for host in hosts.rows():
|
for host in hosts.rows():
|
||||||
|
|||||||
Reference in New Issue
Block a user