Skip to content

Commit

Permalink
GIX-2181: Work around frozen sns canister (#4043)
Browse files Browse the repository at this point in the history
# Motivation

One SNS's root canister was frozen and it broke all SNSes in nns-dapp.

# Changes

Don't throw an error when one of the SNSes is broken but just filter it
out of the wrapper.

# Tests

Tested manually by calling `dfx stop` on one of the root canisters.
Without the fix:
https://drive.google.com/file/d/1xF5zRp62HMpQTmlIWTcuWyl9r5JU0ZT7/view

With the fix:
https://drive.google.com/file/d/19VpUbd27HImQDAe0ywrB78tpFc8zQq9D/view

# Todos

- [x] Add entry to changelog (if necessary).
  • Loading branch information
dskloetd authored Dec 15, 2023
1 parent 1654a64 commit b0422d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-Nns-Dapp-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ proposal is successful, the changes it released will be moved from this file to

* Limit the size of proposal payload rendering errors, as otherwise the error can become too large to return.
* Provide a fallback if proposal payloads don't have the expected type.
* Temporary work-around for broken SNS.

#### Security

Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lib/api/sns-wrapper.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ const loadSnsWrappers = async ({
const error: boolean =
results.find(({ status }) => status === "rejected") !== undefined;
if (error) {
throw new ApiErrorKey("error__sns.init");
const rejectedReasons = results
.filter(({ status }) => status === "rejected")
.map((wrapper) =>
"reason" in wrapper ? wrapper.reason : "Reason not present"
);
console.error("Rejected SNSes:", rejectedReasons);
// Ignoring. SNSes will be filtered out below.
}

return (
Expand Down

0 comments on commit b0422d6

Please sign in to comment.