Skip to content

fix: propagate symbol asset download failures - #2057

Open
NansKong wants to merge 1 commit into
google:masterfrom
NansKong:fix/2055-propagate-download-errors
Open

NansKong wants to merge 1 commit into
google:masterfrom
NansKong:fix/2055-propagate-download-errors

Conversation

@NansKong

Copy link
Copy Markdown

Fixes #2055.

Replaces #2056, which was closed after the CLA rescan endpoint returned HTTP 400 and the check remained pending. The code and validation are unchanged.

Problem

_do_fetch logs and swallows HTTP, connection, and write failures. Joblib therefore treats failed requests as successful tasks. If font processing completes, main persists advanced icon versions even though assets were not downloaded, so later runs skip those versions. A failed font request can also fall through to decompressing a stale local WOFF2 file.

Change

Remove the broad exception handler so failures propagate through joblib and abort the updater before font post-processing and version-cache persistence. Successful requests use the same headers, status check, directory creation, and byte writes as before.

This changes only updater code and offline tests. It does not submit or modify icon designs, SVGs, Android drawables, generated fonts, or the version-cache data, in accordance with the README's icon-file contribution policy.

Validation

  • python -m unittest discover -s update -p '*_test.py' -v: 7 passed.
  • Original code with the same tests: 5 failed, 2 passed.
  • Tests cover successful file writes/version updates, HTTP and connection errors, exception propagation through a two-worker joblib threading backend, byte-for-byte preservation of the version cache on failure, and stopping stale-font decompression after a failed download.
  • Verified on Python 3.11 / Windows x64 with the updater's pinned runtime dependencies (absl-py 1.2.0, requests 2.24.0, fonttools 4.14.0, joblib 1.2.0, brotli 1.0.9 and their pinned requests dependencies).
  • New test file passes Black; changed files compile; git diff --check passes.
  • All requests are mocked and files are written under temporary directories. The scheduled production updater was not run and no live Google assets were downloaded or regenerated.

The issue is established by offline fault injection; this PR does not claim it caused any particular historical missing icon.

This branch has not been deployed

No deployments
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.

Symbol updater swallows failed downloads and advances the version cache

1 participant