Close desktop safety gaps
This commit is contained in:
@@ -223,16 +223,18 @@ failed_state="$(wait_for '.busy == false and .awaiting == false')"
|
||||
jq -e '.lastError | contains("rejected")' <<<"$failed_state" >/dev/null \
|
||||
|| fail "failed apply did not retain a useful recovery message: $failed_state"
|
||||
|
||||
# If an output disconnects while a change is pending, rollback sends one
|
||||
# transaction containing every output that is still connected.
|
||||
# If an output disconnects while a change is pending, the screen-model observer
|
||||
# refreshes topology and rolls back with only the still-connected output. This
|
||||
# intentionally does not call Displays.refresh() through the public harness API.
|
||||
[[ "$(run ipc --pid "$harness_pid" call displays-test applyLayoutFixture 3000 320)" == "true" ]] \
|
||||
|| fail 'disconnect fixture could not start'
|
||||
wait_for '.canConfirm == true' >/dev/null
|
||||
jq '.[0:1]' "$monitor_state" >"$fixture/connected.json"
|
||||
mv "$fixture/connected.json" "$monitor_state"
|
||||
run ipc --pid "$harness_pid" call displays-test refresh >/dev/null
|
||||
wait_for '.layout | length == 1' >/dev/null
|
||||
run ipc --pid "$harness_pid" call displays-test revertChange >/dev/null
|
||||
run ipc --pid "$harness_pid" call displays-test setScreenModel '["DP-2"]' >/dev/null
|
||||
wait_for '(.layout | length == 1) and .awaiting == false and .busy == false' >/dev/null
|
||||
[[ "$(transaction_status | jq -c .primaryFirst)" == '["DP-2"]' ]] \
|
||||
|| fail "primary-first monitor list did not reconcile after hot-unplug: $(transaction_status)"
|
||||
wait_for '.busy == false and .awaiting == false' >/dev/null
|
||||
disconnect_payload="$(tail -1 "$eval_log")"
|
||||
[[ "$(rg -o 'hl\.monitor' <<<"$disconnect_payload" | wc -l)" == "1" ]] \
|
||||
|
||||
Reference in New Issue
Block a user