Repository navigation
Count a font whose download hit another font's file as missing - #2038
Merged
Merged
Conversation
Contributor
|
Coverage report for commit: 4018bd8 Summary - Lines: 93.99% | Methods: 90.78% | Branches: 85.75%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 tasks done
Contributor
|
Coverage report for commit: 4018bd8 Summary - Lines: 90.47% | Methods: 96.03%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
gravitypdf-bot
force-pushed
the
fix/2036-report-failed-conflicts
branch
2 times, most recently
from
November 12, 2026 02:21
cf87d49 to
e43136a
Compare
Base automatically changed from
fix/2021-render-clears-font-failure-by-size
to
development
November 12, 2026 03:31
Site Health, the System Report and the Font Manager went by size alone, so they counted another font's file of a known size at a core font's name as installed, even after a failed download had found it was another font's. Site Health then left out a failure the failed fonts notice listed, and saving a setting didn't schedule the sync. Model_Required_Fonts and the Font Manager's families now leave out the file the downloader's failure record says is another font's. Model_Font_Sources::is_installed(), which only compared sizes, had no callers left and is removed. Refs #2036 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gravitypdf-bot
force-pushed
the
fix/2036-report-failed-conflicts
branch
from
November 12, 2026 04:00
e43136a to
4018bd8
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
After #2035, the failed fonts notice lists a core font once its download gives up because another font's file of a known size is at its name. Site Health, the System Report and the Font Manager still went by size alone, though, so they said the font was installed. Site Health also dropped the failure from its report. They now ask the downloader's failure record, as the render path does since #2035, so all of them agree with the notice. This fixes the Site Health and reporting half of #2036. #2037 fixed the delete half.
Model_Required_Fontsleaves out the other font's file a failed download found. That covers Site Health's missing files, the System Report's installed counts, and the check on settings and form saves that schedules the sync.Model_Font_Sources::is_installed()only compared sizes and had no callers left, so it is removed. It hasn't shipped in a release.Try it
DISABLE_WP_CRONtotrueand make font downloads fail, for example by blocking the download host.DejaVuSerifCondensed.ttffrom the manifest, but different contents, atDejaVuSerifCondensed.ttfin the fonts folder.wp cron event run gfpdf_core_font_sync).Test plan
Model_Required_Fonts, the Site Health test and the Font Manager row each fail without the fix and pass with it.test_an_unwritable_folder_fails_without_a_requestcases, which also fail ondevelopment.Technical detail
Model_Font_Sources::get_own_copy()stays stat-only, because it runs on the render path and can't see the downloader's failure record. #2035 stamps a failure with the size and modified time of the file at the font's name.is_failed_conflict()then says whether the file there is still the one that failed. It is now public.Model_Required_Fonts::is_installed()isget_own_copy()lessis_failed_conflict(). It is used byneeds_download(),get_installed_counts()andget_missing_files(). The downloader is resolved throughGPDFAPI::get_mvc_class(), because bootstrap builds it afterModel_Required_Fontsand passes that model into its constructor.Model_Font_Downloader::get_core_families()applies the same check to each family'spaths. That feeds the Font Manager rows and the delete.get_failures()is cached per request.Skipped review suggestions:
Model_Font_Sourcesso neither model depends on the other. That's a larger refactor.has_own_copy(). It uses the registered downloader's font sources, not the model's own.Closes #2036