Skip to content

Fix #7417: Fix exclusions logic#64

Merged
wordpressfan merged 2 commits intodevelopfrom
fix/7417-fix-exclusions
Aug 15, 2025
Merged

Fix #7417: Fix exclusions logic#64
wordpressfan merged 2 commits intodevelopfrom
fix/7417-fix-exclusions

Conversation

@Miraeld
Copy link
Copy Markdown
Contributor

@Miraeld Miraeld commented Aug 1, 2025

Description

Fixes #7417
Fix the exclusions logic in the beacon

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

What was tested

The beacon script

How to test

Add api.fontshare.com & cdn.fontshare.com to Preload Fonts Exclusions list in BE
From UI, update the dynamic lists data
Enable Preload Fonts
Visit https://rocketlabsqa.ovh/preloadfonts_multiple_external_fonts/ and check Console

Technical description

Documentation

This pull request refines the font preloading logic in the BeaconPreloadFonts class by consolidating and expanding the handling of exclusion lists.

Improvements to font preloading logic:

  • src/BeaconPreloadFonts.js: Updated the exclusion logic to combine preload_fonts_exclusions and external_font_exclusions into a single list (allExclusions) for more comprehensive filtering of font links. This ensures that both types of exclusions are considered when determining whether to preload a font.

New dependencies

None

Risks

None

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

@Miraeld Miraeld self-assigned this Aug 1, 2025
Copilot AI review requested due to automatic review settings August 1, 2025 11:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the exclusions logic in the beacon's font preloading functionality by consolidating two separate exclusion lists into a single comprehensive check. The fix ensures that both preload_fonts_exclusions and external_font_exclusions are considered when determining whether to preload fonts.

  • Combines two exclusion configuration arrays into a single filtering mechanism
  • Updates the exclusion check logic to use the consolidated list
  • Maintains existing error handling structure

Comment thread src/BeaconPreloadFonts.js Outdated
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Aug 1, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-82.99% (target: -1.00%) (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2e2b9e8) 1911 1586 82.99%
Head commit (9caa32b) 0 (-1911) 0 (-1586) 0.00% (-82.99%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#64) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@Miraeld Miraeld linked an issue Aug 1, 2025 that may be closed by this pull request
@wordpressfan wordpressfan merged commit b99d9d6 into develop Aug 15, 2025
5 of 6 checks passed
@wordpressfan wordpressfan deleted the fix/7417-fix-exclusions branch August 15, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.19: Preload fonts external domains

3 participants