Fix/grid group (#1787)

* ci: config rust log

* chore: rename flowy-sdk to appflowy-core

* fix: create group after editing the url

* fix: start listen on new group

* chore: add tests

* refactor: mock data

* ci: update command
This commit is contained in:
Nathan.fooo
2023-02-02 23:02:49 +08:00
committed by GitHub
parent d09574951b
commit 069519589e
73 changed files with 1569 additions and 1900 deletions

View File

@ -20,7 +20,7 @@ use parking_lot::RwLock;
use std::{ffi::CStr, os::raw::c_char};
lazy_static! {
static ref FLOWY_SDK: RwLock<Option<FlowySDK>> = RwLock::new(None);
static ref APPFLOWY_CORE: RwLock<Option<AppFlowyCore>> = RwLock::new(None);
}
#[no_mangle]
@ -30,8 +30,8 @@ pub extern "C" fn init_sdk(path: *mut c_char) -> i64 {
let server_config = get_client_server_configuration().unwrap();
let log_crates = vec!["flowy-ffi".to_string()];
let config = FlowySDKConfig::new(path, "appflowy".to_string(), server_config).log_filter("info", log_crates);
*FLOWY_SDK.write() = Some(FlowySDK::new(config));
let config = AppFlowyCoreConfig::new(path, "appflowy".to_string(), server_config).log_filter("info", log_crates);
*APPFLOWY_CORE.write() = Some(AppFlowyCore::new(config));
0
}
@ -46,7 +46,7 @@ pub extern "C" fn async_event(port: i64, input: *const u8, len: usize) {
port
);
let dispatcher = match FLOWY_SDK.read().as_ref() {
let dispatcher = match APPFLOWY_CORE.read().as_ref() {
None => {
log::error!("sdk not init yet.");
return;
@ -64,7 +64,7 @@ pub extern "C" fn sync_event(input: *const u8, len: usize) -> *const u8 {
let request: AFPluginRequest = FFIRequest::from_u8_pointer(input, len).into();
log::trace!("[FFI]: {} Sync Event: {:?}", &request.id, &request.event,);
let dispatcher = match FLOWY_SDK.read().as_ref() {
let dispatcher = match APPFLOWY_CORE.read().as_ref() {
None => {
log::error!("sdk not init yet.");
return forget_rust(Vec::default());