Skip to content

Commit

Permalink
Update Community canisters post release (#6553)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Oct 10, 2024
1 parent edcb506 commit 828f56a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
2 changes: 2 additions & 0 deletions backend/canisters/community/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

## [[2.0.1377](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1377-community)] - 2024-10-10

### Added

- Add support for expiring access gates ([#6401](https://github.com/open-chat-labs/open-chat/pull/6401))
Expand Down
12 changes: 1 addition & 11 deletions backend/canisters/community/impl/src/lifecycle/post_upgrade.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use crate::jobs::import_groups::finalize_group_import;
use crate::lifecycle::{init_env, init_state};
use crate::memory::get_upgrades_memory;
use crate::{mutate_state, read_state, Data};
use crate::{read_state, Data};
use canister_logger::LogEntry;
use canister_tracing_macros::trace;
use community_canister::post_upgrade::Args;
use ic_cdk::post_upgrade;
use instruction_counts_log::InstructionCountFunctionId;
use stable_memory::get_reader;
use tracing::info;
use types::CanisterId;

#[post_upgrade]
#[trace]
Expand All @@ -32,15 +31,6 @@ fn post_upgrade(args: Args) {

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

let windoge_community = CanisterId::from_text("ow6el-gyaaa-aaaar-av5na-cai").unwrap();
mutate_state(|state| {
if state.env.canister_id() == windoge_community {
for channel in state.data.channels.iter_mut() {
channel.chat.events.populate_search_index();
}
}
});

read_state(|state| {
let now = state.env.now();
state
Expand Down
12 changes: 0 additions & 12 deletions backend/libraries/chat_events/src/chat_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,10 @@ pub struct ChatEvents {
last_updated_timestamps: LastUpdatedTimestamps,
video_call_in_progress: Timestamped<Option<VideoCall>>,
anonymized_id: String,
#[serde(default)]
search_index: SearchIndex,
}

impl ChatEvents {
// TODO remove this
pub fn populate_search_index(&mut self) {
for event in self.main.iter(None, true, EventIndex::default()) {
if let EventOrExpiredRangeInternal::Event(e) = event {
if let ChatEventInternal::Message(m) = &e.event {
self.search_index.push(m.message_index, m.sender, Document::from(&m.content));
}
}
}
}

pub fn new_direct_chat(
them: UserId,
events_ttl: Option<Milliseconds>,
Expand Down

0 comments on commit 828f56a

Please sign in to comment.