Accept partial ams objects; allow plain-HTTP downloads from a local store on request
Windows discovery tool / windows (push) Successful in 57s
Windows discovery tool / windows (push) Successful in 57s
A P1P mid-print pushes ams objects with no unit list; every such update was dropped as "missing field ams", silencing telemetry for the rest of the print (found on the first real dispatch). The unit list now defaults to empty and a partial object does not wipe known units. CONTINUUM_ALLOW_INSECURE_LOCAL_DOWNLOADS=true lets the downloader fetch a presigned URL over plain HTTP, but only from a loopback or RFC 1918 address.
This commit is contained in:
@@ -144,3 +144,13 @@ fn merge_keeps_stage_and_spool_when_a_partial_update_omits_them() {
|
||||
assert_eq!(base.stg, Some(vec![54, 14, 13]));
|
||||
assert!(base.vt_tray.is_some());
|
||||
}
|
||||
|
||||
/// A P1P mid-print pushes `ams` objects without the inner unit list. That
|
||||
/// used to fail the whole report ("missing field `ams`"), silencing telemetry
|
||||
/// for the rest of the print - found on the first real dispatch.
|
||||
#[test]
|
||||
fn a_partial_ams_object_parses_and_keeps_known_units() {
|
||||
let partial = serde_json::json!({"command":"push_status","sequence_id":"1","msg":1,"gcode_state":"RUNNING","ams":{"tray_now":"2"}});
|
||||
let report: PrintReport = serde_json::from_value(partial).expect("a partial ams object should parse");
|
||||
assert!(report.ams.as_ref().is_some_and(|a| a.ams.is_empty()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user