Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unavailable registry more gracefully #2256

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

FrederikBolding
Copy link
Member

This PR makes a few changes to the registry controller implementation to attempt to handle an unavailable registry (e.g. invalid signature) more gracefully.

Instead of throwing when the registry fails to update or populate, we return SnapsRegistryStatus.Unavailable. This status is meant to indicate to the SnapController that we can't currently access the latest registry and thus our data might be out of date. For Snaps that don't require allowlisting, this shouldn't be a problem and they will still be installable. If a user is trying to install a Snap that does require allowlisting they are now greeted with a slightly better error message.

@FrederikBolding FrederikBolding requested a review from a team as a code owner March 8, 2024 10:21
@FrederikBolding FrederikBolding force-pushed the fb/handle-lack-of-registry-more-gracefully branch from 702fee1 to 471d978 Compare March 8, 2024 10:22
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 96.59%. Comparing base (8b461ef) to head (3724684).

Files Patch % Lines
...kages/snaps-controllers/src/snaps/registry/json.ts 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2256      +/-   ##
==========================================
- Coverage   96.61%   96.59%   -0.02%     
==========================================
  Files         337      337              
  Lines        7611     7616       +5     
  Branches     1180     1182       +2     
==========================================
+ Hits         7353     7357       +4     
- Misses        258      259       +1     

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

@FrederikBolding FrederikBolding force-pushed the fb/handle-lack-of-registry-more-gracefully branch from d3ed46e to 3724684 Compare March 8, 2024 12:40
@FrederikBolding FrederikBolding merged commit 3dabbf1 into main Mar 8, 2024
148 of 150 checks passed
@FrederikBolding FrederikBolding deleted the fb/handle-lack-of-registry-more-gracefully branch March 8, 2024 12:47
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