Skip to content

Commit

Permalink
Allow bots to upload 1GB of file data (#7131)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jan 1, 2025
1 parent 16dcdbe commit 5333a56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions backend/canisters/user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Changed

- Allow bots to upload 1GB of file data ([#7131](https://github.com/open-chat-labs/open-chat/pull/7131))

## [[2.0.1542](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1542-user_index)] - 2024-12-19

### Changed
Expand Down
11 changes: 10 additions & 1 deletion backend/canisters/user_index/impl/src/updates/register_bot.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use crate::guards::caller_is_governance_principal;
use crate::model::user_map::Bot;
use crate::model::{MAX_AVATAR_SIZE, MAX_COMMANDS, MAX_DESCRIPTION_LEN};
use crate::{mutate_state, read_state, RuntimeState, USER_LIMIT};
use crate::{mutate_state, read_state, RuntimeState, ONE_GB, USER_LIMIT};
use candid::Principal;
use canister_api_macros::{proposal, update};
use canister_tracing_macros::trace;
use event_store_producer::EventBuilder;
use local_user_index_canister::{BotRegistered, UserIndexEvent};
use rand::RngCore;
use storage_index_canister::add_or_update_users::UserConfig;
use tracing::error;
use types::{UserId, UserType};
use url::Url;
Expand Down Expand Up @@ -89,6 +90,14 @@ fn register_bot_impl(args: Args, state: &mut RuntimeState) {
None,
);

state.data.storage_index_user_sync_queue.push(
state.data.storage_index_canister_id,
UserConfig {
user_id: args.principal,
byte_limit: ONE_GB,
},
);

state.data.event_store_client.push(
EventBuilder::new("user_registered", now)
.with_user(user_id.to_string(), true)
Expand Down

0 comments on commit 5333a56

Please sign in to comment.