chore: checking workspace state consistent after switching workspace (#5201)

* refactor: getting workspace id

* refactor: check workspace id is match for http response

* refactor: check http repsonse in valid by checing the workspace id

* chore: update log

* chore: fix test

* chore: fix test

* chore: add test

* chore: update test
This commit is contained in:
Nathan.fooo
2024-04-26 09:44:07 +08:00
committed by GitHub
parent 65a289648e
commit cc66147bc0
51 changed files with 980 additions and 575 deletions

View File

@ -2,8 +2,10 @@ use client_api::ClientConfiguration;
use std::collections::HashMap;
use std::sync::Arc;
use flowy_error::FlowyResult;
use uuid::Uuid;
use flowy_server::af_cloud::define::ServerUser;
use flowy_server::af_cloud::AppFlowyCloudServer;
use flowy_server::supabase::define::{USER_DEVICE_ID, USER_SIGN_IN_URL};
use flowy_server_pub::af_cloud_config::AFCloudConfiguration;
@ -31,9 +33,17 @@ pub fn af_cloud_server(config: AFCloudConfiguration) -> Arc<AppFlowyCloudServer>
true,
fake_device_id,
"0.5.1",
Arc::new(FakeServerUserImpl),
))
}
struct FakeServerUserImpl;
impl ServerUser for FakeServerUserImpl {
fn workspace_id(&self) -> FlowyResult<String> {
todo!()
}
}
pub async fn generate_sign_in_url(user_email: &str, config: &AFCloudConfiguration) -> String {
let client = client_api::Client::new(
&config.base_url,

View File

@ -134,7 +134,7 @@ pub async fn print_encryption_folder_snapshot(
));
let folder_data = Folder::open(uid, collab, None)
.unwrap()
.get_folder_data()
.get_folder_data(folder_id)
.unwrap();
let json = serde_json::to_value(folder_data).unwrap();
println!("{}", serde_json::to_string_pretty(&json).unwrap());