Skip to content

Commit

Permalink
Unsuspend more users who were also affected (#5248)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jan 23, 2024
1 parent 697cee7 commit 15a9329
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions backend/canisters/user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Notify community canisters when a user is unsuspended ([#5227](https://github.com/open-chat-labs/open-chat/pull/5227))
- Unsuspend user who was only partially unsuspended due to bug ([#5247](https://github.com/open-chat-labs/open-chat/pull/5247))
- Unsuspend more users who were also affected ([#5248](https://github.com/open-chat-labs/open-chat/pull/5248))

## [[2.0.1007](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1007-user_index)] - 2024-01-16

Expand Down
17 changes: 14 additions & 3 deletions backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use ic_cdk_macros::post_upgrade;
use stable_memory::get_reader;
use std::time::Duration;
use tracing::info;
use types::UserId;
use user_index_canister::post_upgrade::Args;
use utils::cycles::init_cycles_dispenser_client;

Expand All @@ -28,11 +29,21 @@ fn post_upgrade(args: Args) {

info!(version = %args.wasm_version, "Post-upgrade complete");

// Unsuspend user @Hugh_Mungus who wasn't unsuspended from communities due to a bug
let users_to_unsuspend: Vec<UserId> = [
"qyzts-uiaaa-aaaar-aw4ca-cai",
"zjayq-ryaaa-aaaar-axhrq-cai",
"o6334-oyaaa-aaaar-awgxa-cai",
"s4i57-nqaaa-aaaar-abzcq-cai",
"vecg6-eqaaa-aaaar-a23rq-cai",
"ne6gg-dqaaa-aaaaf-agzwa-cai",
]
.iter()
.map(|str| Principal::from_text(str).unwrap().into())
.collect();

ic_cdk_timers::set_timer(Duration::ZERO, || {
let hugh_mungus_user_id = Principal::from_text("ne6gg-dqaaa-aaaaf-agzwa-cai").unwrap().into();
ic_cdk::spawn(async move {
unsuspend_user_impl(hugh_mungus_user_id).await;
futures::future::join_all(users_to_unsuspend.into_iter().map(unsuspend_user_impl)).await;
})
});
}

0 comments on commit 15a9329

Please sign in to comment.