Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into prize-fee
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/app/src/components/home/Home.svelte
#	frontend/openchat-agent/src/typebox.ts
#	tsBindings/types.d.ts
  • Loading branch information
megrogan committed Nov 27, 2024
2 parents a335d47 + 5adb2a2 commit 12d841f
Show file tree
Hide file tree
Showing 378 changed files with 6,760 additions and 3,217 deletions.
17 changes: 14 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ members = [
"backend/libraries/search",
"backend/libraries/sha256",
"backend/libraries/stable_memory",
"backend/libraries/stable_memory_map",
"backend/libraries/testing",
"backend/libraries/timer_job_queues",
"backend/libraries/ts_export",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN curl --fail https://sh.rustup.rs -sSf \
rustup target add wasm32-unknown-unknown

# Install IC Wasm
RUN cargo install --version 0.8.0 ic-wasm
RUN cargo install --version 0.9.0 ic-wasm

COPY . /build
WORKDIR /build
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ You can build the OpenChat canister wasms by running `./scripts/docker-build-all
Copyright 2024 OpenChat Labs LTD

Licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html

---

*Our tests run fast and cheap via [RunsOn](https://runs-on.com)*
10 changes: 10 additions & 0 deletions backend/canisters/airdrop_bot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Changed

- Make `ChannelId` comparisons use their 32bit representation ([#6885](https://github.com/open-chat-labs/open-chat/pull/6885))

### Removed

- Remove the old `gate` field which has been superseded by `gate_config` ([#6902](https://github.com/open-chat-labs/open-chat/pull/6902))

## [[2.0.1468](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1468-airdrop_bot)] - 2024-11-24

### Added

- Add an error log with http endpoint ([#6608](https://github.com/open-chat-labs/open-chat/pull/6608))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ async fn prepare_airdrop(config: AirdropConfig, user_index_canister_id: Canister
avatar: OptionUpdate::NoChange,
permissions_v2: None,
events_ttl: OptionUpdate::NoChange,
gate: OptionUpdate::SetToSome(AccessGate::Locked),
gate_config: OptionUpdate::SetToSome(AccessGate::Locked.into()),
public: None,
messages_visible_to_non_members: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ fn post_upgrade(args: Args) {
let memory = get_upgrades_memory();
let reader = get_reader(&memory);

let (mut data, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>) = msgpack::deserialize(reader).unwrap();
let (data, errors, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>, Vec<LogEntry>) =
msgpack::deserialize(reader).unwrap();

data.pending_actions_queue.set_max_concurrency(20);

// TODO: After release change this to
// let (data, errors, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>, Vec<LogEntry>) = msgpack::deserialize(reader).unwrap();
canister_logger::init_with_logs(data.test_mode, Vec::new(), logs, traces);
canister_logger::init_with_logs(data.test_mode, errors, logs, traces);

let env = init_env(data.rng_seed);
init_state(env, data, args.wasm_version);
Expand Down
2 changes: 1 addition & 1 deletion backend/canisters/airdrop_bot/impl/src/model/airdrops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ mod tests {
airdrops.set_next(
AirdropConfig {
community_id: random_principal().into(),
channel_id: 1,
channel_id: 1u32.into(),
start: now + 1_000,
algorithm: AirdropAlgorithm::V1(V1Algorithm {
main_chat_fund: 80_000,
Expand Down
24 changes: 24 additions & 0 deletions backend/canisters/community/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Changed

- Simplify how we store and query proposal votes ([#6906](https://github.com/open-chat-labs/open-chat/pull/6906))

### Removed

- Remove code to deduplicate @everyone mentions ([#6901](https://github.com/open-chat-labs/open-chat/pull/6901))
- Remove code to migrate metrics to new reduced size format ([#6901](https://github.com/open-chat-labs/open-chat/pull/6901))
- Remove code to migrate community members to new reduced size format ([#6901](https://github.com/open-chat-labs/open-chat/pull/6901))
- Remove the old `gate` field which has been superseded by `gate_config` ([#6902](https://github.com/open-chat-labs/open-chat/pull/6902))

## [[2.0.1477](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1477-community)] - 2024-11-27

### Fixed

- Dedupe @everyone mentions using timer job ([#6899](https://github.com/open-chat-labs/open-chat/pull/6899))

## [[2.0.1475](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1475-community)] - 2024-11-26

### Added

- Add new prize message criteria ([#6831](https://github.com/open-chat-labs/open-chat/pull/6831))
Expand All @@ -30,6 +49,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Disallow promoting bots to owners ([#6865](https://github.com/open-chat-labs/open-chat/pull/6865))
- Reduce the number of events stored on the heap in the `HybridMap` ([#6867](https://github.com/open-chat-labs/open-chat/pull/6867))
- Return `FailedToDeserialize` and log error if unable to read event ([#6873](https://github.com/open-chat-labs/open-chat/pull/6873))
- Extract stable memory map so it can store additional datasets ([#6876](https://github.com/open-chat-labs/open-chat/pull/6876))
- Avoid iterating all channel members when determining who to notify of new message ([#6877](https://github.com/open-chat-labs/open-chat/pull/6877))
- Reduce size of community members when serialized ([#6883](https://github.com/open-chat-labs/open-chat/pull/6883))
- Avoid many cases where we were iterating over all community members ([#6884](https://github.com/open-chat-labs/open-chat/pull/6884))
- Make `ChannelId` comparisons use their 32bit representation ([#6885](https://github.com/open-chat-labs/open-chat/pull/6885))

### Removed

Expand Down
3 changes: 0 additions & 3 deletions backend/canisters/community/api/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ type CreateChannelArgs = record {
history_visible_to_new_joiners : bool;
permissions_v2 : opt GroupPermissions;
events_ttl : opt Milliseconds;
gate : opt AccessGate;
gate_config : opt AccessGateConfig;
external_url : opt text;
messages_visible_to_non_members: opt bool;
Expand Down Expand Up @@ -1017,7 +1016,6 @@ type UpdateChannelArgs = record {
avatar : DocumentUpdate;
permissions_v2 : opt OptionalGroupPermissions;
events_ttl : EventsTimeToLiveUpdate;
gate : AccessGateUpdate;
gate_config : AccessGateConfigUpdate;
public : opt bool;
messages_visible_to_non_members: opt bool;
Expand Down Expand Up @@ -1054,7 +1052,6 @@ type UpdateCommunityArgs = record {
avatar : DocumentUpdate;
banner : DocumentUpdate;
permissions : opt OptionalCommunityPermissions;
gate : AccessGateUpdate;
gate_config : AccessGateConfigUpdate;
public : opt bool;
primary_language : opt text;
Expand Down
5 changes: 2 additions & 3 deletions backend/canisters/community/api/src/lifecycle/init.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use candid::{CandidType, Principal};
use serde::{Deserialize, Serialize};
use types::{
AccessGate, AccessGateConfig, BuildVersion, CanisterId, CommunityPermissions, Document, Milliseconds, Rules, SourceGroup,
UserId, UserType,
AccessGateConfig, BuildVersion, CanisterId, CommunityPermissions, Document, Milliseconds, Rules, SourceGroup, UserId,
UserType,
};

#[derive(CandidType, Serialize, Deserialize, Debug)]
Expand All @@ -29,7 +29,6 @@ pub struct Args {
pub proposals_bot_user_id: UserId,
pub escrow_canister_id: CanisterId,
pub internet_identity_canister_id: CanisterId,
pub gate: Option<AccessGate>,
pub gate_config: Option<AccessGateConfig>,
pub default_channels: Vec<String>,
pub default_channel_rules: Option<Rules>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use candid::CandidType;
use serde::{Deserialize, Serialize};
use ts_export::ts_export;
use types::{
AccessGate, AccessGateConfig, ChannelId, Document, FieldTooLongResult, FieldTooShortResult, GroupPermissions, GroupSubtype,
AccessGateConfig, ChannelId, Document, FieldTooLongResult, FieldTooShortResult, GroupPermissions, GroupSubtype,
Milliseconds, Rules,
};

Expand All @@ -19,7 +19,6 @@ pub struct Args {
pub messages_visible_to_non_members: Option<bool>,
pub permissions_v2: Option<GroupPermissions>,
pub events_ttl: Option<Milliseconds>,
pub gate: Option<AccessGate>,
pub gate_config: Option<AccessGateConfig>,
pub external_url: Option<String>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use candid::CandidType;
use serde::{Deserialize, Serialize};
use ts_export::ts_export;
use types::{
AccessGate, AccessGateConfig, ChannelId, Document, FieldTooLongResult, FieldTooShortResult, Milliseconds, OptionUpdate,
AccessGateConfig, ChannelId, Document, FieldTooLongResult, FieldTooShortResult, Milliseconds, OptionUpdate,
OptionalGroupPermissions, UpdatedRules, Version,
};

Expand All @@ -18,8 +18,6 @@ pub struct Args {
pub permissions_v2: Option<OptionalGroupPermissions>,
#[ts(as = "types::OptionUpdateU64")]
pub events_ttl: OptionUpdate<Milliseconds>,
#[ts(as = "types::OptionUpdateAccessGate")]
pub gate: OptionUpdate<AccessGate>,
#[ts(as = "types::OptionUpdateAccessGateConfig")]
pub gate_config: OptionUpdate<AccessGateConfig>,
pub public: Option<bool>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use candid::CandidType;
use serde::{Deserialize, Serialize};
use ts_export::ts_export;
use types::{
AccessGate, AccessGateConfig, Document, FieldTooLongResult, FieldTooShortResult, OptionUpdate,
OptionalCommunityPermissions, UpdatedRules, Version,
AccessGateConfig, Document, FieldTooLongResult, FieldTooShortResult, OptionUpdate, OptionalCommunityPermissions,
UpdatedRules, Version,
};

#[ts_export(community, update_community)]
Expand All @@ -17,8 +17,6 @@ pub struct Args {
#[ts(as = "types::OptionUpdateDocument")]
pub banner: OptionUpdate<Document>,
pub permissions: Option<OptionalCommunityPermissions>,
#[ts(as = "types::OptionUpdateAccessGate")]
pub gate: OptionUpdate<AccessGate>,
#[ts(as = "types::OptionUpdateAccessGateConfig")]
pub gate_config: OptionUpdate<AccessGateConfig>,
pub public: Option<bool>,
Expand Down
5 changes: 5 additions & 0 deletions backend/canisters/community/impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ serde = { workspace = true }
serde_bytes = { workspace = true }
serde_repr = { workspace = true }
stable_memory = { path = "../../../libraries/stable_memory" }
stable_memory_map = { path = "../../../libraries/stable_memory_map" }
storage_bucket_client = { path = "../../../libraries/storage_bucket_client" }
timer_job_queues = { path = "../../../libraries/timer_job_queues" }
tracing = { workspace = true }
Expand All @@ -67,3 +68,7 @@ user_canister_c2c_client = { path = "../../user/c2c_client" }
user_index_canister = { path = "../../user_index/api" }
user_index_canister_c2c_client = { path = "../../user_index/c2c_client" }
utils = { path = "../../../libraries/utils" }

[dev-dependencies]
proptest = { workspace = true }
test-strategy = { workspace = true }
Loading

0 comments on commit 12d841f

Please sign in to comment.