chore: fix log (#4740)

* chore: fix log

* chore: fix log

* chore: bump client api
This commit is contained in:
Nathan.fooo 2024-02-26 15:27:12 +08:00 committed by GitHub
parent daedf95c95
commit 8d50ad2936
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 271 additions and 196 deletions

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);

View File

@ -5,6 +5,7 @@ import 'package:appflowy/env/backend_env.dart';
import 'package:appflowy/env/cloud_env.dart';
import 'package:appflowy/user/application/auth/device_id.dart';
import 'package:appflowy_backend/appflowy_backend.dart';
import 'package:appflowy_backend/log.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as path;
@ -38,6 +39,7 @@ class InitRustSDKTask extends LaunchTask {
rustEnvs: context.config.rustEnvs,
);
await context.getIt<FlowySDK>().init(jsonEncode(env.toJson()));
Log.info('Rust SDK initialized');
}
@override

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);

View File

@ -137,20 +137,20 @@ typedef _store_dart_post_cobject_Dart = void Function(
Pointer<NativeFunction<Int8 Function(Int64, Pointer<Dart_CObject>)>> ptr,
);
void log(
void rust_log(
int level,
Pointer<ffi.Utf8> data,
) {
_invoke_log(level, data);
_invoke_rust_log(level, data);
}
final _invoke_log_Dart _invoke_log = _dart_ffi_lib
.lookupFunction<_invoke_log_C, _invoke_log_Dart>('backend_log');
typedef _invoke_log_C = Void Function(
final _invoke_rust_log_Dart _invoke_rust_log = _dart_ffi_lib
.lookupFunction<_invoke_rust_log_C, _invoke_rust_log_Dart>('rust_log');
typedef _invoke_rust_log_C = Void Function(
Int64 level,
Pointer<ffi.Utf8> data,
);
typedef _invoke_log_Dart = void Function(
typedef _invoke_rust_log_Dart = void Function(
int level,
Pointer<ffi.Utf8>,
);

View File

@ -9,6 +9,7 @@ import 'ffi.dart';
class Log {
static final shared = Log();
// ignore: unused_field
late Logger _logger;
Log() {
@ -26,63 +27,23 @@ class Log {
}
static void info(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) {
log(0, toNativeUtf8(msg));
} else {
Log.shared._logger.i(
msg,
error: error,
stackTrace: stackTrace,
);
}
rust_log(0, toNativeUtf8(msg));
}
static void debug(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) {
log(1, toNativeUtf8(msg));
} else {
Log.shared._logger.d(
msg,
error: error,
stackTrace: stackTrace,
);
}
rust_log(1, toNativeUtf8(msg));
}
static void warn(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) {
log(3, toNativeUtf8(msg));
} else {
Log.shared._logger.w(
msg,
error: error,
stackTrace: stackTrace,
);
}
rust_log(3, toNativeUtf8(msg));
}
static void trace(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) {
log(2, toNativeUtf8(msg));
} else {
Log.shared._logger.t(
msg,
error: error,
stackTrace: stackTrace,
);
}
rust_log(2, toNativeUtf8(msg));
}
static void error(dynamic msg, [dynamic error, StackTrace? stackTrace]) {
if (isReleaseVersion()) {
log(4, toNativeUtf8(msg));
} else {
Log.shared._logger.e(
msg,
error: error,
stackTrace: stackTrace,
);
}
rust_log(4, toNativeUtf8(msg));
}
}

View File

@ -14,6 +14,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);

View File

@ -162,7 +162,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -714,7 +714,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"again",
"anyhow",
@ -818,7 +818,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-trait",
@ -840,7 +840,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-trait",
@ -869,7 +869,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"collab",
@ -888,7 +888,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"bytes",
@ -903,7 +903,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"chrono",
@ -940,7 +940,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-stream",
@ -979,7 +979,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"collab",
@ -1202,7 +1202,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa 1.0.6",
"phf 0.11.2",
"phf 0.8.0",
"smallvec",
]
@ -1313,7 +1313,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -1744,6 +1744,7 @@ dependencies = [
"serde",
"serde_json",
"serde_repr",
"sysinfo",
"tokio",
"tokio-stream",
"tracing",
@ -2586,7 +2587,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"futures-util",
@ -2603,7 +2604,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -3058,7 +3059,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"reqwest",
@ -3715,6 +3716,15 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"
[[package]]
name = "ntapi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
dependencies = [
"winapi",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
@ -4759,9 +4769,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
[[package]]
name = "rayon"
version = "1.7.0"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b"
checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
dependencies = [
"either",
"rayon-core",
@ -4769,20 +4779,18 @@ dependencies = [
[[package]]
name = "rayon-core"
version = "1.11.0"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d"
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"num_cpus",
]
[[package]]
name = "realtime-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -4806,7 +4814,7 @@ dependencies = [
[[package]]
name = "realtime-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -5454,7 +5462,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -5720,6 +5728,21 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "sysinfo"
version = "0.30.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"windows 0.52.0",
]
[[package]]
name = "system-configuration"
version = "0.5.1"
@ -6934,7 +6957,7 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]]
name = "websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"futures-channel",
"futures-util",
@ -7051,6 +7074,16 @@ dependencies = [
"windows-targets 0.48.0",
]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.52.0",
]
[[package]]
name = "windows-bindgen"
version = "0.39.0"
@ -7061,6 +7094,15 @@ dependencies = [
"windows-tokens",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]]
name = "windows-implement"
version = "0.39.0"
@ -7334,7 +7376,7 @@ dependencies = [
[[package]]
name = "workspace-template"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"async-trait",

View File

@ -82,7 +82,7 @@ custom-protocol = ["tauri/custom-protocol"]
# Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" }
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "375318774a53e2056b1d693b231eee3336ad1937" }
# Please use the following script to update collab.
# Working directory: frontend
#
@ -92,10 +92,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }

View File

@ -221,7 +221,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -545,7 +545,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"again",
"anyhow",
@ -618,7 +618,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-trait",
@ -640,7 +640,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"collab",
@ -659,7 +659,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"bytes",
@ -674,7 +674,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"chrono",
@ -711,7 +711,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-stream",
@ -749,7 +749,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"collab",
@ -901,7 +901,7 @@ dependencies = [
"cssparser-macros",
"dtoa-short",
"itoa",
"phf 0.11.2",
"phf 0.8.0",
"smallvec",
]
@ -946,7 +946,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -1292,6 +1292,7 @@ dependencies = [
"bytes",
"client-api",
"collab-document",
"collab-folder",
"collab-plugins",
"fancy-regex 0.11.0",
"flowy-codegen",
@ -1699,7 +1700,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"futures-util",
@ -1716,7 +1717,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -2050,7 +2051,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"reqwest",
@ -2779,7 +2780,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
dependencies = [
"phf_macros 0.8.0",
"phf_macros",
"phf_shared 0.8.0",
"proc-macro-hack",
]
@ -2799,7 +2800,6 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
dependencies = [
"phf_macros 0.11.2",
"phf_shared 0.11.2",
]
@ -2867,19 +2867,6 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "phf_macros"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
dependencies = [
"phf_generator 0.11.2",
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]]
name = "phf_shared"
version = "0.8.0"
@ -3308,7 +3295,7 @@ dependencies = [
[[package]]
name = "realtime-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -3332,7 +3319,7 @@ dependencies = [
[[package]]
name = "realtime-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -3779,7 +3766,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -4721,7 +4708,7 @@ checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
[[package]]
name = "websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"futures-channel",
"futures-util",
@ -5028,4 +5015,4 @@ dependencies = [
[[patch.unused]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=35c649ea201e12bf40f5352a8bf9c46141e013a5#35c649ea201e12bf40f5352a8bf9c46141e013a5"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"

View File

@ -55,7 +55,7 @@ codegen-units = 1
# Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" }
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "375318774a53e2056b1d693b231eee3336ad1937" }
# Please use the following script to update collab.
# Working directory: frontend
#
@ -65,10 +65,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }

View File

@ -163,7 +163,7 @@ checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -673,7 +673,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"again",
"anyhow",
@ -746,7 +746,7 @@ dependencies = [
[[package]]
name = "collab"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-trait",
@ -768,7 +768,7 @@ dependencies = [
[[package]]
name = "collab-database"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-trait",
@ -797,7 +797,7 @@ dependencies = [
[[package]]
name = "collab-document"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"collab",
@ -816,7 +816,7 @@ dependencies = [
[[package]]
name = "collab-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"bytes",
@ -831,7 +831,7 @@ dependencies = [
[[package]]
name = "collab-folder"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"chrono",
@ -868,7 +868,7 @@ dependencies = [
[[package]]
name = "collab-plugins"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"async-stream",
@ -907,7 +907,7 @@ dependencies = [
[[package]]
name = "collab-user"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=cf37285dd5adee7ead61b6fdc51bf735e5129c53#cf37285dd5adee7ead61b6fdc51bf735e5129c53"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=9f340e85e09af97a83d44b66069a93d63c6f2279#9f340e85e09af97a83d44b66069a93d63c6f2279"
dependencies = [
"anyhow",
"collab",
@ -1237,7 +1237,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -1731,6 +1731,7 @@ dependencies = [
"serde",
"serde_json",
"serde_repr",
"sysinfo",
"tokio",
"tokio-stream",
"tracing",
@ -2410,7 +2411,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"futures-util",
@ -2427,7 +2428,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -2698,7 +2699,7 @@ dependencies = [
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows",
"windows 0.48.0",
]
[[package]]
@ -2821,7 +2822,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"reqwest",
@ -3319,6 +3320,15 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21"
[[package]]
name = "ntapi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
dependencies = [
"winapi",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
@ -4265,9 +4275,9 @@ dependencies = [
[[package]]
name = "rayon"
version = "1.7.0"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b"
checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
dependencies = [
"either",
"rayon-core",
@ -4275,14 +4285,12 @@ dependencies = [
[[package]]
name = "rayon-core"
version = "1.11.0"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d"
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"num_cpus",
]
[[package]]
@ -4297,7 +4305,7 @@ dependencies = [
[[package]]
name = "realtime-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -4321,7 +4329,7 @@ dependencies = [
[[package]]
name = "realtime-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"bincode",
@ -4909,7 +4917,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"app-error",
@ -5149,6 +5157,21 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "sysinfo"
version = "0.30.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"windows 0.52.0",
]
[[package]]
name = "system-configuration"
version = "0.5.1"
@ -6084,7 +6107,7 @@ checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]]
name = "websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"futures-channel",
"futures-util",
@ -6160,6 +6183,25 @@ dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core",
"windows-targets 0.52.0",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
@ -6305,7 +6347,7 @@ dependencies = [
[[package]]
name = "workspace-template"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=8e9031c6692a73b4ceb2c94ae887af5fa3d42afe#8e9031c6692a73b4ceb2c94ae887af5fa3d42afe"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=375318774a53e2056b1d693b231eee3336ad1937#375318774a53e2056b1d693b231eee3336ad1937"
dependencies = [
"anyhow",
"async-trait",

View File

@ -105,7 +105,7 @@ incremental = false
# Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9031c6692a73b4ceb2c94ae887af5fa3d42afe" }
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "375318774a53e2056b1d693b231eee3336ad1937" }
# Please use the following script to update collab.
# Working directory: frontend
#
@ -115,10 +115,10 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "8e9
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cf37285dd5adee7ead61b6fdc51bf735e5129c53" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "9f340e85e09af97a83d44b66069a93d63c6f2279" }

View File

@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);

View File

@ -5,7 +5,7 @@ use std::{ffi::CStr, os::raw::c_char};
use lazy_static::lazy_static;
use parking_lot::Mutex;
use tracing::{error, trace};
use tracing::{debug, error, info, trace, warn};
use flowy_core::config::AppFlowyCoreConfig;
use flowy_core::*;
@ -175,18 +175,51 @@ async fn post_to_flutter(response: AFPluginEventResponse, port: i64) {
}
#[no_mangle]
pub extern "C" fn backend_log(level: i64, data: *const c_char) {
let c_str = unsafe { CStr::from_ptr(data) };
let log_str = c_str.to_str().unwrap();
pub extern "C" fn rust_log(level: i64, data: *const c_char) {
info!("backend_log");
// Check if the data pointer is not null
if data.is_null() {
error!("[flutter error]: null pointer provided to backend_log");
return;
}
// Don't change the mapping relation between number and level
match level {
0 => tracing::info!("{}", log_str),
1 => tracing::debug!("{}", log_str),
2 => tracing::trace!("{}", log_str),
3 => tracing::warn!("{}", log_str),
4 => tracing::error!("{}", log_str),
_ => (),
let log_result = unsafe { CStr::from_ptr(data) }.to_str();
// Handle potential UTF-8 conversion error
let log_str = match log_result {
Ok(str) => str,
Err(e) => {
error!(
"[flutter error]: Failed to convert C string to Rust string: {:?}",
e
);
return;
},
};
// Simplify logging by determining the log level outside of the match
let log_level = match level {
0 => "info",
1 => "debug",
2 => "trace",
3 => "warn",
4 => "error",
_ => {
warn!("[flutter error]: Unsupported log level: {}", level);
return;
},
};
// Log the message at the appropriate level
match log_level {
"info" => info!("[Flutter]: {}", log_str),
"debug" => debug!("[Flutter]: {}", log_str),
"trace" => trace!("[Flutter]: {}", log_str),
"warn" => warn!("[Flutter]: {}", log_str),
"error" => error!("[Flutter]: {}", log_str),
_ => {
warn!("[flutter error]: Unsupported log level: {}", log_level);
},
}
}

View File

@ -47,6 +47,7 @@ serde_json.workspace = true
serde_repr.workspace = true
futures.workspace = true
walkdir = "2.4.0"
sysinfo = "0.30.5"
[features]
default = ["rev-sqlite"]

View File

@ -3,6 +3,7 @@
use flowy_storage::ObjectStorageService;
use std::sync::Arc;
use std::time::Duration;
use sysinfo::System;
use tokio::sync::RwLock;
use tracing::{debug, error, event, info, instrument};
@ -79,6 +80,8 @@ impl AppFlowyCore {
// Init the key value database
let store_preference = Arc::new(StorePreferences::new(&config.storage_path).unwrap());
info!("🔥{:?}", &config);
info!("💡System info: {:?}", System::long_os_version());
let task_scheduler = TaskDispatcher::new(Duration::from_secs(2));
let task_dispatcher = Arc::new(RwLock::new(task_scheduler));
runtime.spawn(TaskRunner::run(task_dispatcher.clone()));

View File

@ -132,7 +132,7 @@ impl DocumentManager {
/// Returns Document for given object id
/// If the document does not exist in local disk, try get the doc state from the cloud.
/// If the document exists, open the document and cache it
#[tracing::instrument(level = "debug", skip(self), err)]
#[tracing::instrument(level = "info", skip(self), err)]
pub async fn get_document(&self, doc_id: &str) -> FlowyResult<Arc<MutexDocument>> {
if let Some(doc) = self.documents.lock().get(doc_id).cloned() {
return Ok(doc);

View File

@ -1,5 +1,6 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::time::Duration;
use anyhow::Error;
use client_api::collab_sync::collab_msg::CollabMessage;
@ -262,6 +263,9 @@ fn spawn_ws_conn(
if enable_sync.load(Ordering::SeqCst) {
match api_client.ws_url(&cloned_device_id).await {
Ok(ws_addr) => {
// sleep two seconds and then try to reconnect
tokio::time::sleep(Duration::from_secs(2)).await;
event!(tracing::Level::INFO, "🟢reconnecting websocket");
let _ = ws_client.connect(ws_addr, &cloned_device_id).await;
},

View File

@ -5,6 +5,7 @@ use serde_json::Value;
use tracing::{Event, Id, Subscriber};
use tracing_bunyan_formatter::JsonStorage;
use tracing_core::metadata::Level;
use tracing_core::span::Attributes;
use tracing_subscriber::{fmt::MakeWriter, layer::Context, registry::SpanRef, Layer};
const LEVEL: &str = "level";
@ -31,7 +32,7 @@ where
pub fn new(make_writer: W) -> Self {
Self {
make_writer,
with_target: false,
with_target: true,
phantom: std::marker::PhantomData,
}
}
@ -63,8 +64,8 @@ where
map_serializer.serialize_entry("target", &span.metadata().target())?;
}
map_serializer.serialize_entry("line", &span.metadata().line())?;
map_serializer.serialize_entry("file", &span.metadata().file())?;
// map_serializer.serialize_entry("line", &span.metadata().line())?;
// map_serializer.serialize_entry("file", &span.metadata().file())?;
let extensions = span.extensions();
if let Some(visitor) = extensions.get::<JsonStorage>() {
@ -102,9 +103,9 @@ pub enum Type {
impl fmt::Display for Type {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let repr = match self {
Type::EnterSpan => "Start",
Type::ExitSpan => "End",
Type::Event => "Event",
Type::EnterSpan => "START",
Type::ExitSpan => "END",
Type::Event => "EVENT",
};
write!(f, "{}", repr)
}
@ -113,19 +114,12 @@ impl fmt::Display for Type {
fn format_span_context<'b, S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>>(
span: &SpanRef<'b, S>,
ty: Type,
context: &Context<'_, S>,
_: &Context<'_, S>,
) -> String {
match context.lookup_current() {
None => {
if matches!(ty, Type::EnterSpan) {
format!("[🟢 {} - {}]", span.metadata().name().to_uppercase(), ty)
} else {
format!("[🔵 {} - {}]", span.metadata().name().to_uppercase(), ty)
}
},
Some(_) => {
format!("[{} - {}]", span.metadata().name().to_uppercase(), ty)
},
}
}
@ -227,6 +221,13 @@ where
}
}
fn on_new_span(&self, _attrs: &Attributes, id: &Id, ctx: Context<'_, S>) {
let span = ctx.span(id).expect("Span not found, this is a bug");
if let Ok(serialized) = self.serialize_span(&span, Type::EnterSpan, &ctx) {
let _ = self.emit(serialized);
}
}
fn on_close(&self, id: Id, ctx: Context<'_, S>) {
let span = ctx.span(&id).expect("Span not found, this is a bug");
if let Ok(serialized) = self.serialize_span(&span, Type::ExitSpan, &ctx) {

View File

@ -55,7 +55,6 @@ impl Builder {
let subscriber = tracing_subscriber::fmt()
.with_timer(CustomTime)
.with_ansi(true)
.with_target(false)
.with_max_level(tracing::Level::TRACE)
.with_thread_ids(false)
.pretty()