Files
openproject/spec/lib
Kabiru Mwenja b181e1fde1 Follow-up refactors for the text-macro preload cache (#23285)
* 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.
2026-05-20 21:36:09 +03:00
..
2026-05-20 15:20:16 +02:00
2025-09-17 20:00:58 +02:00