Skip to content

fix: Skip refetching the registry in handleRegistryUpdate#3961

Merged
FrederikBolding merged 3 commits intomainfrom
fb/skip-refetch-when-handling-registry-update
Apr 15, 2026
Merged

fix: Skip refetching the registry in handleRegistryUpdate#3961
FrederikBolding merged 3 commits intomainfrom
fb/skip-refetch-when-handling-registry-update

Conversation

@FrederikBolding
Copy link
Copy Markdown
Member

@FrederikBolding FrederikBolding commented Apr 15, 2026

Our tests didn't catch this, but in production, triggering SnapRegistryController:registryUpdated triggers handleRegistryUpdate which may try to refetch the registry and cause an infinite loop. We can fix this by passing a flag to not refetch the registry.


Note

Medium Risk
Changes registry verification/version-resolution calls to optionally skip refetching, which could alter behavior on allowlist misses and impact snap blocking/auto-update flows if misused.

Overview
Prevents an infinite update loop when handling SnapRegistryController:registryUpdated by ensuring SnapController#handleRegistryUpdate does not trigger a registry refetch during blocklist checks and preinstalled allowlist version resolution.

This adds a skipRefetch flag plumbed through SnapRegistryController:get and SnapController#resolveAllowlistVersion (forwarded to SnapRegistryController:resolveVersion), and updates the corresponding SnapController test to assert the new get(..., true) call signature.

Reviewed by Cursor Bugbot for commit c0401da. Bugbot is set up for automated code reviews on this repo. Configure here.

@FrederikBolding FrederikBolding changed the title fix: Skip refetching the registry in handleRegistryUpdate fix: Skip refetching the registry in handleRegistryUpdate Apr 15, 2026
@FrederikBolding FrederikBolding marked this pull request as ready for review April 15, 2026 08:10
@FrederikBolding FrederikBolding requested a review from a team as a code owner April 15, 2026 08:10
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.55%. Comparing base (22f8da9) to head (c0401da).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3961      +/-   ##
==========================================
- Coverage   98.56%   98.55%   -0.01%     
==========================================
  Files         428      428              
  Lines       12347    12349       +2     
  Branches     1940     1942       +2     
==========================================
+ Hits        12170    12171       +1     
- Misses        177      178       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit cac76dd Apr 15, 2026
128 of 129 checks passed
@FrederikBolding FrederikBolding deleted the fb/skip-refetch-when-handling-registry-update branch April 15, 2026 08:26
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.

2 participants