Skip to content

Fix custom favicon persistence across instances - #1935

Merged
Paul Lizer (paullizer) merged 3 commits into
microsoft:mainfrom
paullizer:paullizer-custom-favicon-persistence
Nov 13, 2026
Merged

Paul Lizer (paullizer) merged 3 commits into
microsoft:mainfrom
paullizer:paullizer-custom-favicon-persistence

Conversation

@paullizer

@paullizer Paul Lizer (paullizer) commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Restore the saved favicon at startup and reconcile it before serving the existing static favicon asset, so restarted/scaled instances and later uploads retain custom branding.
  • Reuse existing base64 storage, favicon versioning and shared settings reads; no Redis requirement or new browser URL.
  • Validate ICO bytes, skip identical files, replace changed files atomically, and log failures without truncating a usable icon.
  • Main-first PR explicitly requested by the user; the separate Development port is Fix custom favicon persistence across instances on Development #1936. No merge requested.

Linked issue

Fixes #1932. Related historical report: #292. Development port: #1936.

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Application version: 0.261.061 → 0.261.063. The original fix was implemented in 0.261.062; 0.261.063 adds the explanatory CodeQL review clarification without changing behavior. No deployer changes.

Testing / validation

  • python -m pytest .\functional_tests\test_custom_favicon_persistence.py .\functional_tests\test_app_settings_store_consistency.py .\functional_tests\test_app_settings_import_boundaries.py -q -x — passed, 35 tests before the comment-only review follow-up.
  • python -m pytest .\functional_tests\test_custom_favicon_persistence.py -q -x — passed, 4 real-module cold-import cases after the review follow-up.
  • python -m pytest .\ui_tests\test_custom_favicon_persistence.py -q -x — passed, 1 Chromium browser test against an isolated offline fixture using the real template head and favicon hook; rerun passed after the review follow-up.
  • python .\functional_tests\test_app_settings_cache_versioning.py — passed, 2 checks.
  • python -X utf8 .\functional_tests\test_custom_logo_file_preservation_on_startup.py — passed. Initial execution without UTF-8 failed only on Windows console emoji encoding; rerun succeeded.
  • python -X utf8 .\functional_tests\route_tests\test_route_blueprint_policy_inventory.py — passed, 6 checks.
  • python -X utf8 .\functional_tests\route_tests\test_route_unauthenticated_policy_contract.py — passed, 4 checks.
  • python -X utf8 .\functional_tests\route_tests\test_route_policy_test_coverage.py — passed, 2 checks.
  • python .\functional_tests\test_docs_site_quality.py — passed, 6 checks, including the review follow-up docs.
  • python -m py_compile .\application\single_app\app.py .\application\single_app\config.py .\functional_tests\test_custom_favicon_persistence.py .\ui_tests\test_custom_favicon_persistence.py — passed before the follow-up; python -m py_compile .\application\single_app\config.py passed afterward.
  • git -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --cached --check — passed, including the review follow-up.

Coverage includes real-module cold imports in normal/optimized Python, independent instance roots, Redis/Cosmos/read-fallback settings, file loss, invalid data, failed replacements, and concurrent whole-file reads. No customer/staging deployment was modified or tested. Already-open tabs may retain a cached favicon until another request/reload; Windows file-sharing failures are logged and retried on a subsequent request.

The CodeQL empty-except review finding is addressed with a comment explaining that an absent instance-local file intentionally falls through to creation from the stored favicon. The review thread was already resolved when inspected. This is not a suppression and does not change behavior.

Before the comment-only follow-up, GitHub checks for CodeQL (Python, JavaScript/TypeScript, Actions), syntax, Swagger, and CLA all passed. CI for the new head is pending. Merge-policy blocker: enforce-branch-flow fails because repository policy requires PRs targeting main to originate from Staging. This main-first PR was explicitly requested; no branch-policy/workflow bypass or merge was attempted. See the branch-flow check.

Documentation

  • Release notes updated, or not needed
  • Feature documentation updated, or not needed
  • Fix documentation updated, or not needed

Added docs/explanation/fixes/CUSTOM_FAVICON_PERSISTENCE_FIX.md; updated the branding guide, logging tag inventory, and release notes.

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security())
  • Settings sent to non-admin frontends use sanitize_settings_for_user()
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS
  • No secrets, keys, connection strings, or local-only artifacts are included

No production routes were added. Raw settings remain server-side; the existing favicon file is the only generated browser asset.

Restore the stored favicon at startup and before static delivery, with validated atomic materialization and isolated regression coverage.

Refs microsoft#1932

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread application/single_app/config.py Fixed
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit fdce754 into microsoft:main Nov 13, 2026
7 of 8 checks passed
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.

Custom favicon reverts after instance restart or scale-out

2 participants