Retry loading fallback fonts in case of network errors - #3152
Merged
Conversation
- Added linear backoff mechanism for retries on font download failures. - Enhanced error handling by throwing when all font downloads fail. - Improved logging to include retry delay and failure details.
…ehavior - Added test cases to validate retry logic with same codepoints on failure. - Introduced tests for linear backoff mechanism with retry delays. - Ensured success resets backoff and worker continues processing new batches despite failures.
Oleksandr Karpovich (eymar)
approved these changes
Jun 23, 2026
- Ensured retry logic only triggers when fonts list is non-empty and all entries are null.
Apolo (ApoloApps)
pushed a commit
to ApoloApps/compose-multiplatform-core
that referenced
this pull request
Jul 20, 2026
**Issue:** If an error occurred while loading a fallback font for an unresolved symbol (e.g., a network failure), the batch of codepoints was silently lost. Due to deduplication in the UnresolvedSymbolsRegistry and caching of the Skia paragraph in the ParagraphLayouter, the character was considered “already processed” and was never reported again—it remained unrenderable (tofu) forever, even after network recovery. **Solution:** In WebFallbackFontDownloader, a failed batch is no longer lost: it is resubmitted for re-download via a non-blocking coroutine with a linear backoff (5s * errorCount), which is reset upon any successful download. A successful retry follows the standard flow (onFontsLoaded → onNewFontInstalled()), invalidates the paragraph cache, and redraws the text. The ParagraphLayouter remains unchanged. Fixes https://youtrack.jetbrains.com/issue/CMP-10324 ## Testing Added tests cases ## Release Notes ### Fixes - Web - Web: retry loading fallback fonts in case of network errors
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.
Issue: If an error occurred while loading a fallback font for an unresolved symbol (e.g., a network failure), the batch of codepoints was silently lost. Due to deduplication in the UnresolvedSymbolsRegistry and caching of the Skia paragraph in the ParagraphLayouter, the character was considered “already processed” and was never reported again—it remained unrenderable (tofu) forever, even after network recovery.
Solution: In WebFallbackFontDownloader, a failed batch is no longer lost: it is resubmitted for re-download via a non-blocking coroutine with a linear backoff (5s * errorCount), which is reset upon any successful download. A successful retry follows the standard flow (onFontsLoaded → onNewFontInstalled()), invalidates the paragraph cache, and redraws the text. The ParagraphLayouter remains unchanged.
Fixes https://youtrack.jetbrains.com/issue/CMP-10324
Testing
Added tests cases
Release Notes
Fixes - Web