mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
b181e1fde1
* Scope SQL log assertions to target SELECTs in alias-fold-in spec The N+1 guard was counting the entire QueryRecorder log, which made it brittle against any incidental Setting/permission query that landed on the same render path. Switch to scoped greps against the two SELECTs we actually care about: the work_packages batched query and the sidecar alias pluck. A regression on either now fails with a clear message pointing at the offending source. * Flatten matcher preload wrapping into an iterative fold The recursive shift-and-recurse shape mutated a duplicated array and forwarded an anonymous block at every frame, which obscured what the loop was actually doing: wrap each opt-in matcher's preload hook around the inner block, first matcher outermost. The iterative form walks the matcher list once in reverse and rebinds a lambda, so the nesting order is visible without unwinding a recursion. * Make the WP preload cache's stringified-key invariant explicit Both ends of the cache assumed every key was a string, but the contract lived only in the read site's `identifier.to_s` and an ambient confidence that the identifier column is text. Normalize at write time too, swap the safe-navigation lookup for `dig`, and leave a one-line note at the canonical builder so a future reader doesn't have to grep the call sites to convince themselves a numeric input will resolve.