Fix Bricks synchronization for empty class sets - #10
Draft
Jan-CoreBunch wants to merge 1 commit into
Draft
Conversation
Always run Bricks synchronization after the stylesheet is persisted, including when Core Framework generates no utility classes. Normalize empty selector payloads, prevent blank global classes, and calculate removed CF class IDs before filtering previous classes. Remove stale locked-class references while preserving non-CF classes, settings, variables, and categories. Add regression coverage for empty, non-empty, removal, preservation, and idempotent synchronization. Manual validation against Bricks 2.3.11 covered variables-only synchronization and stress testing up to 5,000 synthetic Bricks documents with 100 elements each. Cleanup remained correct and error-free. Removal time scaled approximately linearly, reaching 19.09 seconds in the largest synthetic case.
Jan-CoreBunch
force-pushed
the
fix/bricks-empty-class-sync
branch
from
August 14, 2026 11:05
65bf3ad to
1eb2c30
Compare
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.
Summary
Fixes Bricks synchronization when Core Framework generates variables but no utility classes, and removes stale CF-owned classes immediately when the final generated class is disabled.
Root cause
update-classeswas never called and Bricks variables were not refreshed.Changes
_cclass._cssGlobalClassesreferences.StylesheetStorage.Automated validation
bun run php-test:wp— 26 tests and 47 assertions passed.bun run test:www— 23 suites and 147 tests passed.bun run build:wp— passed.git diff --checkpassed.Manual functional validation
Using Bricks 2.3.11:
Manual performance validation
All
update-classesrequests returned HTTP 200 and completed without errors.Class addition remained effectively constant. Removal scaled approximately linearly because stale CF references must be removed from Bricks post metadata. The 5,000-document cases are considered an extreme-site caveat rather than a blocker for this focused fix. Further optimization can be considered separately if real-world usage demonstrates a need.