Mirror eager's excluded cache columns in the lazy URL filter evaluation - #29517
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 3m 10s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 3m 3s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 2m 23s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 34s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | 1s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 4s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | <1s | View ↗ |
nx run-many -t lint -p ghost,ghost-monorepo |
✅ Succeeded | 1s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 5s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-22 02:48:27 UTC
ref https://linear.app/ghost/issue/HKG-1937 Eager drops a set of columns from its in-memory URL cache (the exclude lists in services/url/config.js) and evaluates each router's collection filter against that reduced record. An excluded column therefore reads as absent, and NQL treats absent as null — so a filter like custom_template:null matches and eager serves the post. Lazy loads full records and saw the real column value, so the same filter failed to match and it 404'd posts eager routes. Since we are preserving eager's behaviour, lazy now strips eager's excluded columns before evaluating router filters (and neither requires nor force-loads them), reproducing eager's blind spot exactly where eager has one. The base filter is untouched: it still runs against the full record, as eager applies status/type/visibility at query time rather than in the cache.
adaaeef to
8811f19
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #29517 +/- ##
==========================================
+ Coverage 74.54% 74.57% +0.03%
==========================================
Files 1609 1609
Lines 141454 141521 +67
Branches 17266 17287 +21
==========================================
+ Hits 105443 105538 +95
+ Misses 34945 34917 -28
Partials 1066 1066
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Part of the eager → lazy URL service migration (compare mode). Shadow comparison flagged published posts on sites whose collection filter references a column the eager service drops from its cache (e.g.
custom_template:null): eager serves the post, the lazy service returned/404/.The eager service excludes a set of columns from its in-memory URL cache and evaluates each router's collection filter against that reduced record. An excluded column reads as absent, and NQL treats absent as null — so
custom_template:nullmatches and eager serves the post. The lazy service loads full records and saw the real value, so the filter failed and it 404'd posts eager routes. Since the migration must preserve eager's live URLs, the lazy service now strips eager's excluded columns before evaluating router filters (and neither requires nor force-loads them), reproducing eager's blind spot exactly where eager has one. The base filter is untouched — it still runs against the full record, since eager appliesstatus/type/visibilityat query time rather than in the cache.