ZT-576 · Autos don't fire on save while the block is in a COMPLETE status
| Status | Done (finding, no lasting config change) |
| Ticket | ZT-576 |
| Requested by | KAJ Jacobs (found during the Permitting fixes, Nov 9–10) |
| Sections affected | 07 · Permitting, 09 · Inspection, 01 · Project level (and any block that gets new autos) |
Request
Auto controls built since Nov 9 don't run on a click or a save, even when they're placed and their condition passes. Only auto + timed ones run, and only on the nightly run. Find out why.
Review
See the ticket's Evidence. Examples: First-Time Permits Approved (auto) (ZT-573) didn't run on 30823 or 28349. Expiration Date Updated (auto) (ZT-564) didn't run on a save. The timed autos from ZT-565 and ZT-559 did run overnight. control_history times out, so the reason can't be read in Phoenix.
Admin checklist
In the ticket. Ask the Phoenix dev first, then run the 28349 throwaway-auto test.
New SOP
No change for end users. Admins: until it's fixed, build new autos as Auto + Timed and place them, or put the action on the button.
Config check
D5 test, Nov 10 (agent run on 28349):
- Built rule 4319 "(Process Block: Permitting) Custom Field: Queue Note-Permitting Queue Note EQUAL ZT576" and control ZT-576 Test (auto). Its condition is only that rule, and its one action, Set OSC Value, sets Permitting Queue Note to "ZT-576 test fired" with Override Existing on. It was set to Auto, not Timed, and placed last (22nd) in Permitting's Automatic Controls.
- 13:34 MT: typed ZT576 and saved. Didn't fire (0 runs). 13:35: saved again after a real edit. Didn't fire.
- This confirms the bug with the simplest possible case: a brand-new, placed auto whose one rule passes on a plain text field doesn't run on save.
- 13:36: Timed turned on and left in place. Check Nov 11: does 28349's Permitting Queue Note read "ZT-576 test fired"?
- Cleanup after the check: clear the note, unplace and archive the control, and archive rule 4319.
Follow-up, 13:47–13:55 MT:
- ZT-576 Test (auto) shows 1 run, which happened between 13:36 and 13:47, after Timed was turned on. Only 28349's block has the note "ZT576", so rule 4319 (Permitting Queue Note EQUAL ZT576) matched just that block. Text EQUAL rules do work.
- The note didn't change, because the action value was wrong. Set OSC Value takes a SQL expression: other controls use
now(),null,trueandnow() + interval '2 years'. PlainZT-576 test firedisn't valid SQL, so the write failed silently. Text needs single quotes:'ZT-576 test fired'. - So far: auto-only didn't run on a save. Once Timed was on, the control ran within about 11 minutes, so the timed check runs more often than nightly.
- D5b was cancelled. D5c quotes the value, turns Timed off and retests on 25485, because 28349's block has already used its one run.
D5c, 14:01–14:05 MT (25485):
- With the value quoted and Timed off, ZT-576 Test (auto) fired on the first save on 25485's Permitting block, whose status is Pending All Permits Approved, base ON HOLD. The quotes show in the field, so the value is written as literal text and the quotes weren't actually needed.
- New lead: on 28349 the test didn't fire on save, and 28349's block is All Permits Approved, base COMPLETE. First-Time Permits Approved (auto) (ZT-573) needs that same status, rule 3394 ((Process Block: Permitting) Process Block Object Status EQUAL All Permits Approved). So its misses fit too. Possible rule: autos don't fire on save while the block is in a COMPLETE status.
- The run count kept rising (3 → 8) after Timed was turned off. It can't be broken down, because the history query times out, and it stops once the control is archived.
- D5d tests the COMPLETE-block lead on 28349 with a fresh control, then cleans up.
D5d, 14:08–14:15 MT (28349): confirmed.
- ZT-576 Test 2 (auto) had the condition Permitting status EQUAL All Permits Approved AND Queue Note EQUAL ZT576, with Auto on and Timed off. After a real save on 28349, whose block is at All Permits Approved (COMPLETE), it had 0 runs. 25485, whose block is ON HOLD, had fired on its first save with the same kind of control.
- Conclusion: autos don't fire on save while their own block is in a COMPLETE base status. This is now recorded in
tools/DOC-GUIDE.mdunder "When auto controls run". - Cleanup: both test controls are archived. The ZT576 rule is left active, because its archive returned a 409 error; it's on no control, and KAJ said to leave it. The agent was asked to clear the test notes on 28349 and 25485.
Made by
KAJ Jacobs through the Chrome agent. Audit user 2284 (KAJ Jacobs), Nov 10, 20:08–21:15 UTC.