Repository navigation
fix(bricks): avoid multiplying postmeta joins during class cleanup - #46
Open
Jan-CoreBunch wants to merge 2 commits into
Open
Jan-CoreBunch wants to merge 2 commits into
Jan-CoreBunch wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
What
Removing Core Framework classes can hang a Bricks site because reference discovery generates five postmeta joins. Replace the five OR/EXISTS clauses with one EXISTS clause using
compare_key => IN, so WordPress generates a single join across the same five metadata keys.Keep the existing
get_posts()post type/status handling, metadata batching, and class-reference cleanup. Add coverage for all five keys and a real WordPress SQL regression check that short-circuits execution before a potentially explosive query can run.Why
The five joins multiply intermediate rows on posts with lots of unrelated metadata. A customer reported a six-hour query that stalled their site. Batching the later cleanup does not bound this initial lookup.
The new query preserves WordPress query behavior while removing the join multiplication; it does not require a post type allowlist or custom SQL.
The PR also reuses the dependency-only fix from #45 to unblock the existing critical security audit: pin
proxy-addrto 2.0.8 andshell-quoteto 1.11.0. The lockfile synchronizes existing workspace version metadata; no other dependencies are upgraded and no Figma application changes are included.Verification
The Docker run used a temporary Windows-compatible copy of the E2E runner with the fixture checks appended:
The GitHub Actions WordPress E2E job built the release ZIP from a fresh checkout, including Gutenberg assets, and passed
bun run e2e:wpon WordPress 7.1.3 / PHP 8.2.34. This supplies fresh-build validation in addition to the local fixture run, which used existing built assets. Temporary runners, fixtures, and build artifacts are not included in this PR.The dependency update also passed
bun install --frozen-lockfile --lockfile-only --ignore-scriptsandbun audit --audit-level=criticalin an isolated Bun 1.3.11 container (both exit 0).All checks passed on commit
1d4a33b: Build & Typecheck, web tests, PHP tests, and WordPress release E2E, plus both Socket Security checks.