Repository navigation
Require Delayed for conditions that read the admin screen - #166
Merged
Merged
Conversation
schlessera
force-pushed
the
fix/161-screen-delay
branch
from
October 23, 2026 19:36
dd781b3 to
1e4cd95
Compare
schlessera
added a commit
to mwpd/content-freshness
that referenced
this pull request
Oct 23, 2026
Ported from mwpd/basic-scaffold@0e56aa5 (mwpd/basic-scaffold#166). The post age column already waits for current_screen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #161
What changed
architecture.queryContextNeedsDelaynow also reports aConditionalwhoseis_needed()directly calls a configured screen function,get_current_screenby default, without implementingDelayed. The newqueryContextNeedsDelay.screenFunctionslist is set inphpstan.neon.dist, validated intests/php/PHPStan/rules.neon, and an empty list turns the screen check off. Screen calls get their own message namingcurrent_screen, sincewpdoes not fire in admin requests. Query function messages are unchanged. The docs and the "I need a service only in some requests" pattern cover the screen case.Why this shape
A second list on the same rule keeps one identifier and one
Delayedcheck, and only the message differs. A separate rule would duplicate the scope checks for no gain.Proof
The new test (
test_screen_conditions_require_delayed) was written first and failed before the change: no diagnostic was reported for theget_current_screen()fixture. After the change it passes, together with the delayed fixture, the empty-list case and the unchanged query cases.Checklist
composer testandcomposer lintpass locally, and CI is green on the current head.breakingand a ruling.Anything left open
Nothing.