Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97614742bb | ||
|
|
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]);
|
||||
const observed=device.observed;
|
||||
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 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 перед отправкой настроек.':'');
|
||||
|
||||
@@ -63,6 +63,12 @@ def apply(hosts, identifier, revision):
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
)
|
||||
or time.time() - host["last_sync_at"] > 30
|
||||
):
|
||||
|
||||
@@ -78,6 +78,12 @@ def enqueue(hosts, identifier, request_id, preset_id):
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
}:
|
||||
raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.")
|
||||
count = db.execute(
|
||||
|
||||
@@ -249,6 +249,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
)
|
||||
)
|
||||
automatic_access = None
|
||||
@@ -325,6 +331,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
}:
|
||||
raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.")
|
||||
if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in {
|
||||
@@ -351,6 +363,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
}:
|
||||
raise EquipmentError("Для смены SIM установите актуальный VPS Host.")
|
||||
else:
|
||||
@@ -402,6 +420,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
),
|
||||
"request-position": (
|
||||
"0.1.8",
|
||||
@@ -443,6 +467,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
),
|
||||
"pulse-output": (
|
||||
"0.1.9",
|
||||
@@ -483,6 +513,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
),
|
||||
"set-output": (
|
||||
"0.1.10",
|
||||
@@ -522,6 +558,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
),
|
||||
}
|
||||
if source.get("status", {}).get("version") not in versions[command["kind"]]:
|
||||
@@ -571,6 +613,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
)
|
||||
for h in (source, target)
|
||||
):
|
||||
@@ -658,6 +706,12 @@ def start(
|
||||
"0.1.44",
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
"0.2.2",
|
||||
"0.2.3",
|
||||
"0.2.4",
|
||||
"0.2.5",
|
||||
}
|
||||
if durable_delivery:
|
||||
lifetime = (
|
||||
|
||||
+1
-1
@@ -322,6 +322,6 @@
|
||||
"web_protocol.py": "f9c3eba194144e6cc839e80997917967b8075bdbc866fdbefa6929b55cd27c86"
|
||||
},
|
||||
"schema": "nodedc.arnavi-client-contract/v1",
|
||||
"server_version": "0.1.46",
|
||||
"server_version": "0.2.5",
|
||||
"synthetic_only": true
|
||||
}
|
||||
|
||||
@@ -72,3 +72,10 @@ def test_initial_usb_apply_accepts_current_shipped_host():
|
||||
host["status"]["version"] = version
|
||||
assert apply(hosts, "device", 1) == {"ok": True}
|
||||
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.5"
|
||||
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
|
||||
|
||||
|
||||
@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", "0.2.5"]
|
||||
)
|
||||
def test_queue_survives_restart_and_idempotent_submit(ready, monkeypatch, version):
|
||||
equipment, hosts, row = ready
|
||||
for host in hosts.rows():
|
||||
|
||||
Reference in New Issue
Block a user