Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
qinluhe committed Mar 29, 2024
2 parents 87b6fac + d77fb77 commit 99287b0
Show file tree
Hide file tree
Showing 63 changed files with 2,680 additions and 2,526 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ jobs:
sed -i '/image: appflowyinc\/admin_frontend:/d' docker-compose.yml
cat docker-compose.yml
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Run Docker-Compose
run: |
docker compose up -d
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

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

20 changes: 11 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tokio = { workspace = true, features = [
] }
tokio-stream = "0.1.14"
tokio-util = { version = "0.7.10", features = ["io"] }
futures-util = { version = "0.3.30", features = ["std", "io"] }
futures-util ={ version = "0.3.30" , features = ["std","io"] }
once_cell = "1.19.0"
chrono = { version = "0.4.31", features = ["serde", "clock"], default-features = false }
derive_more = { version = "0.99" }
Expand All @@ -47,7 +47,7 @@ validator = "0.16.1"
bytes = "1.5.0"
rcgen = { version = "0.10.0", features = ["pem", "x509-parser"] }
mime = "0.3.17"
rust-s3 = { version = "0.33.0", default-features = false, features = ["tokio-rustls-tls", "with-tokio", "no-verify-ssl"] }
rust-s3 = {version = "0.33.0", default-features = false, features = ["tokio-rustls-tls", "with-tokio", "no-verify-ssl"] }
redis = { workspace = true, features = ["json", "tokio-comp", "connection-manager"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["registry", "env-filter", "ansi", "json"] }
Expand All @@ -71,6 +71,8 @@ semver = "1.0.22"

# collab
collab = { version = "0.1.0", features = ["async-plugin"] }
collab-document = { version = "0.1.0" }
collab-folder = { version = "0.1.0" }
collab-entity = { version = "0.1.0" }

#Local crate
Expand Down Expand Up @@ -163,7 +165,8 @@ bincode = "1.3.3"
client-websocket = { path = "libs/client-websocket" }
collab = { version = "0.1.0" }
collab-folder = { version = "0.1.0" }
tracing = { version = "0.1.40" }
collab-document = { version = "0.1.0" }
tracing = { version = "0.1.40"}
collab-entity = { version = "0.1.0" }
gotrue = { path = "libs/gotrue" }
redis = "0.25.2"
Expand All @@ -183,11 +186,10 @@ inherits = "release"
debug = true

[patch.crates-io]
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "409058aad0969c4d4429151317428a3d17f341d1" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "409058aad0969c4d4429151317428a3d17f341d1" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "409058aad0969c4d4429151317428a3d17f341d1" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "409058aad0969c4d4429151317428a3d17f341d1" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c08d23f5a1f9f0de9465a3b248aedeaf8cd65381" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c08d23f5a1f9f0de9465a3b248aedeaf8cd65381" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c08d23f5a1f9f0de9465a3b248aedeaf8cd65381" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c08d23f5a1f9f0de9465a3b248aedeaf8cd65381" }

[features]
custom_env = []
ai_enable = []
ai_enable = []
5 changes: 5 additions & 0 deletions libs/app-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ pub enum AppError {
#[cfg(feature = "bincode_error")]
#[error(transparent)]
BincodeError(#[from] bincode::Error),

#[error("{0}")]
NoRequiredData(String),
}

impl AppError {
Expand Down Expand Up @@ -164,6 +167,7 @@ impl AppError {
AppError::TokioJoinError(_) => ErrorCode::Internal,
#[cfg(feature = "bincode_error")]
AppError::BincodeError(_) => ErrorCode::Internal,
AppError::NoRequiredData(_) => ErrorCode::NoRequiredData,
}
}
}
Expand Down Expand Up @@ -268,6 +272,7 @@ pub enum ErrorCode {
SerdeError = 1022,
NetworkError = 1023,
UserUnAuthorized = 1024,
NoRequiredData = 1025,
}

impl ErrorCode {
Expand Down
5 changes: 4 additions & 1 deletion libs/client-api-for-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ pub struct ClientAPI {
impl ClientAPI {
pub fn new(config: ClientAPIConfig) -> ClientAPI {
init_logger();
let configuration = ClientConfiguration::new(config.configuration.compression_quality, config.configuration.compression_buffer_size);
let configuration = ClientConfiguration::default();
configuration.to_owned().with_compression_buffer_size(config.configuration.compression_buffer_size);
configuration.to_owned().with_compression_quality(config.configuration.compression_quality);

let client = Client::new(config.base_url.as_str(), config.ws_addr.as_str(), config.gotrue_url.as_str(), config.device_id.as_str(), configuration, config.client_id.as_str());
log::debug!("Client API initialized, config: {:?}", config);
ClientAPI {
Expand Down
1 change: 1 addition & 0 deletions libs/client-api-test-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tokio-stream = "0.1.14"
tracing.workspace = true
collab-folder.workspace = true
collab = { workspace = true, features = ["async-plugin"] }
collab-document.workspace = true
client-api = { path = "../client-api", features = ["collab-sync", "test_util"] }
once_cell = "1.19.0"
tempfile = "3.9.0"
Expand Down
3 changes: 2 additions & 1 deletion libs/client-api-test-util/src/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use collab::core::collab_plugin::EncodedCollab;
use collab::core::collab_state::SyncState;
use collab::core::origin::{CollabClient, CollabOrigin};
use collab::preclude::Collab;

use collab_entity::CollabType;
use collab_folder::Folder;
use database_entity::dto::{
Expand Down Expand Up @@ -806,7 +807,7 @@ pub async fn assert_client_collab_include_value(
object_id: &str,
expected: Value,
) -> Result<(), Error> {
let secs = 30;
let secs = 60;
let object_id = object_id.to_string();
let mut retry_count = 0;
loop {
Expand Down
Loading

0 comments on commit 99287b0

Please sign in to comment.