Repository navigation
Don't record a font failure when another request already saved the font - #2008
Merged
Merged
Conversation
Contributor
|
Coverage report for commit: fc618b9 Summary - Lines: 93.99% | Methods: 90.96% | Branches: 85.66%
🤖 Jest coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
gravitypdf-bot
force-pushed
the
fix/font-downloader-false-failure
branch
from
November 5, 2026 03:47
a658193 to
1b16a21
Compare
Contributor
|
Coverage report for commit: fc618b9 Summary - Lines: 89.64% | Methods: 95.77%
🤖 PHPUnit coverage report |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 of 6 tasks
gravitypdf-bot
force-pushed
the
fix/font-downloader-false-failure
branch
from
November 6, 2026 00:34
1b16a21 to
ca0c80a
Compare
gravitypdf-bot
changed the base branch from
feature/core-font-upgrade-prune
to
feature/font-file-conflict-rename
November 6, 2026 00:34
jakejackson1
force-pushed
the
fix/font-downloader-false-failure
branch
from
November 6, 2026 03:06
ca0c80a to
643db41
Compare
gravitypdf-bot
force-pushed
the
fix/font-downloader-false-failure
branch
from
November 9, 2026 06:05
643db41 to
061de6d
Compare
Base automatically changed from
feature/font-file-conflict-rename
to
development
November 9, 2026 06:12
gravitypdf-bot
force-pushed
the
fix/font-downloader-false-failure
branch
from
November 9, 2026 06:16
061de6d to
3b8bd6d
Compare
When the move into the fonts folder failed but the font there already matched the manifest (another request saved it first), save() kept that font yet returned false, so download() recorded a failure. The retry then found the file and returned early without clearing it, leaving the failure entry and the failed fonts notice in place. A failed move whose destination matches the manifest now deletes the temp file and succeeds, whether the destination is the font's name or its hashed copy. download() clears any failure and back-off for a font it finds on disk (at its name or as a hashed copy), which also covers fonts copied in by hand and failures that already gave up. get_retries() no longer special-cases a due file on disk, as the sync's download() of it now clears it, so is_resolved() is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gravitypdf-bot
force-pushed
the
fix/font-downloader-false-failure
branch
from
November 9, 2026 06:17
3b8bd6d to
fc618b9
Compare
4 of 6 tasks
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
When two requests download the same core font at once, the one whose move into the fonts folder fails kept the valid font the other request saved, but still reported a failure. The retry then found the file and returned early without clearing anything, so the failure entry and the failed fonts notice stayed put.
get_retries()no longer special-cases a due file already on disk, andis_resolved()is removed.Try it
wp option update gfpdf_core_font_failures '{"DejaVuSans.ttf":{"retry_at":0,"gave_up":1762300000}}' --format=json(the failed fonts notice shows in the admin).DejaVuSans.ttfintowp-content/uploads/PDF_EXTENDED_TEMPLATES/fonts/.gfpdf_core_font_failuresoption no longer lists the font and the notice is gone.Test plan
test_an_unwritable_folder_fails_without_a_requestx2 in each suite (the container runs as root)Model_Font_Downloader.phpMore info
save()is handed the destination, so its check after a failed move covers a hashed copy the same way as the plain name. The check is now split: a file matching the manifest means another request won the race, so the temp download is deleted andsave()returns true, which letsdownload()clear the failure. Any other file at the path is still removed as a partial copy.download()clears the failure on the early return for a font it finds on disk. That is a no-op without an entry, and the failures are read once per request, so the cost is one network option read. It also covers failures that already gave up, whichget_retries()skipped, and fonts found outside the sync. The sync passes every due file todownload()with$verifyon, which is whyget_retries()no longer needsis_resolved().A render checks only the size of a file at the font's name, so a same-size file from another font also clears a failure on render. The sync still finds that file by its hash and tries again, so the retry count can restart in that case rather than reaching a give-up.