diff --git a/.github/workflows/rustlint.yml b/.github/workflows/rustlint.yml index a8fee925..eb0d0e60 100644 --- a/.github/workflows/rustlint.yml +++ b/.github/workflows/rustlint.yml @@ -11,7 +11,7 @@ env: SQLX_VERSION: 0.7.1 SQLX_FEATURES: "rustls,postgres" SQLX_OFFLINE: true - RUST_TOOLCHAIN: "1.80" + RUST_TOOLCHAIN: "1.81" jobs: test: diff --git a/.sqlx/query-26f293af01281f6f4a99fd69d3a4acc1a556dd3628873fa3ce3e8eaa18ccda1b.json b/.sqlx/query-ad216288cbbe83aba35b5d04705ee5964f1da4f3839c4725a6784c13f2245379.json similarity index 50% rename from .sqlx/query-26f293af01281f6f4a99fd69d3a4acc1a556dd3628873fa3ce3e8eaa18ccda1b.json rename to .sqlx/query-ad216288cbbe83aba35b5d04705ee5964f1da4f3839c4725a6784c13f2245379.json index d6bba3f1..9bc39f3e 100644 --- a/.sqlx/query-26f293af01281f6f4a99fd69d3a4acc1a556dd3628873fa3ce3e8eaa18ccda1b.json +++ b/.sqlx/query-ad216288cbbe83aba35b5d04705ee5964f1da4f3839c4725a6784c13f2245379.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n select c.workspace_id, c.oid, c.partition_key\n from af_collab c\n join af_workspace w on c.workspace_id = w.workspace_id\n where not coalesce(w.settings['disable_search_indexding']::boolean, false)\n and not exists (\n select 1\n from af_collab_embeddings em\n where em.oid = c.oid and em.partition_key = 0)", + "query": "\n select c.workspace_id, c.oid, c.partition_key\n from af_collab c\n join af_workspace w on c.workspace_id = w.workspace_id\n where not coalesce(w.settings['disable_search_indexding']::boolean, false)\n and not exists (\n select 1 from af_collab_embeddings em\n where em.oid = c.oid and em.partition_key = 0\n )\n ", "describe": { "columns": [ { @@ -28,5 +28,5 @@ false ] }, - "hash": "26f293af01281f6f4a99fd69d3a4acc1a556dd3628873fa3ce3e8eaa18ccda1b" + "hash": "ad216288cbbe83aba35b5d04705ee5964f1da4f3839c4725a6784c13f2245379" } diff --git a/Cargo.lock b/Cargo.lock index 23f02402..cee803e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -168,7 +168,7 @@ dependencies = [ "parse-size", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -342,7 +342,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -353,7 +353,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -394,7 +394,7 @@ dependencies = [ "jwt", "rand 0.8.5", "redis 0.25.4", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "sha2", @@ -552,12 +552,12 @@ dependencies = [ "appflowy-ai-client", "bincode", "getrandom 0.2.15", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "serde_repr", "sqlx", - "thiserror", + "thiserror 1.0.63", "tokio", "tsify", "url", @@ -576,11 +576,11 @@ dependencies = [ "futures", "infra", "pin-project", - "reqwest 0.12.5", + "reqwest", "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", "tracing-subscriber", @@ -670,7 +670,7 @@ dependencies = [ "rayon", "rcgen", "redis 0.25.4", - "reqwest 0.11.27", + "reqwest", "sanitize-filename", "scraper", "secrecy", @@ -683,10 +683,10 @@ dependencies = [ "snowflake", "sqlx", "tempfile", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", - "tokio-tungstenite", + "tokio-tungstenite 0.26.1", "tokio-util", "tonic", "tonic-build", @@ -755,7 +755,7 @@ dependencies = [ "serde_repr", "shared-entity", "sqlx", - "thiserror", + "thiserror 1.0.63", "tiktoken-rs", "tokio", "tokio-stream", @@ -798,13 +798,13 @@ dependencies = [ "mime_guess", "prometheus-client", "redis 0.25.4", - "reqwest 0.12.5", + "reqwest", "secrecy", "serde", "serde_json", "serde_repr", "sqlx", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-util", @@ -864,7 +864,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -894,7 +894,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -968,7 +968,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -990,7 +990,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -1001,7 +1001,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -1015,7 +1015,7 @@ dependencies = [ "crc32fast", "futures-lite", "pin-project", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-util", ] @@ -1048,7 +1048,7 @@ dependencies = [ "secrecy", "serde", "sqlx", - "thiserror", + "thiserror 1.0.63", "tracing", ] @@ -1244,7 +1244,7 @@ dependencies = [ "hex", "hmac", "http 0.2.12", - "http 1.1.0", + "http 1.2.0", "once_cell", "p256", "percent-encoding", @@ -1376,7 +1376,7 @@ dependencies = [ "aws-smithy-types", "bytes", "http 0.2.12", - "http 1.1.0", + "http 1.2.0", "pin-project-lite", "tokio", "tracing", @@ -1394,7 +1394,7 @@ dependencies = [ "bytes-utils", "futures-core", "http 0.2.12", - "http 1.1.0", + "http 1.2.0", "http-body 0.4.6", "http-body 1.0.1", "http-body-util", @@ -1442,7 +1442,7 @@ dependencies = [ "axum-core", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "hyper 1.4.1", @@ -1475,7 +1475,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "mime", @@ -1498,7 +1498,7 @@ dependencies = [ "bytes", "cookie 0.18.1", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "mime", @@ -1669,7 +1669,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "syn_derive", ] @@ -1870,7 +1870,7 @@ dependencies = [ "rhai", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", ] @@ -2044,7 +2044,7 @@ dependencies = [ "pin-project", "prost 0.13.3", "rayon", - "reqwest 0.11.27", + "reqwest", "scraper", "semver", "serde", @@ -2052,10 +2052,11 @@ dependencies = [ "serde_repr", "serde_urlencoded", "shared-entity", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-retry", "tokio-stream", + "tokio-tungstenite 0.20.1", "tokio-util", "tracing", "url", @@ -2105,7 +2106,7 @@ dependencies = [ "mime", "once_cell", "opener", - "reqwest 0.11.27", + "reqwest", "scraper", "serde", "serde_json", @@ -2125,13 +2126,12 @@ version = "0.1.0" dependencies = [ "futures-channel", "futures-util", - "http 0.2.12", "httparse", "js-sys", "percent-encoding", - "thiserror", + "thiserror 1.0.63", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "wasm-bindgen", "web-sys", ] @@ -2139,7 +2139,7 @@ dependencies = [ [[package]] name = "collab" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "arc-swap", @@ -2152,7 +2152,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -2164,7 +2164,7 @@ dependencies = [ [[package]] name = "collab-database" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "async-trait", @@ -2192,7 +2192,7 @@ dependencies = [ "sha2", "strum", "strum_macros", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-util", @@ -2204,7 +2204,7 @@ dependencies = [ [[package]] name = "collab-document" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "arc-swap", @@ -2215,7 +2215,7 @@ dependencies = [ "nanoid", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -2225,7 +2225,7 @@ dependencies = [ [[package]] name = "collab-entity" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "bytes", @@ -2237,7 +2237,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "uuid", "walkdir", ] @@ -2245,7 +2245,7 @@ dependencies = [ [[package]] name = "collab-folder" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "arc-swap", @@ -2257,7 +2257,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -2267,7 +2267,7 @@ dependencies = [ [[package]] name = "collab-importer" version = "0.1.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "async-recursion", @@ -2294,7 +2294,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-util", "tracing", @@ -2324,8 +2324,8 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", - "tokio-tungstenite", + "thiserror 1.0.63", + "tokio-tungstenite 0.20.1", "yrs", ] @@ -2339,7 +2339,7 @@ dependencies = [ "collab", "collab-entity", "serde", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", "yrs", @@ -2364,7 +2364,7 @@ dependencies = [ "redis 0.25.4", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tokio-util", @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "collab-user" version = "0.2.0" -source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=2443178e4249354c094867875f300cc924cbe0e2#2443178e4249354c094867875f300cc924cbe0e2" +source = "git+https://github.com/AppFlowy-IO/AppFlowy-Collab?rev=c45a2120361f94bbedb787cdd2192a38c94c7f5f#c45a2120361f94bbedb787cdd2192a38c94c7f5f" dependencies = [ "anyhow", "collab", @@ -2522,17 +2522,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "cookie" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - [[package]] name = "cookie" version = "0.18.1" @@ -2546,29 +2535,13 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" -dependencies = [ - "cookie 0.17.0", - "idna 0.3.0", - "log", - "publicsuffix", - "serde", - "serde_derive", - "serde_json", - "time", - "url", -] - -[[package]] -name = "cookie_store" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" +checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9" dependencies = [ "cookie 0.18.1", - "idna 0.5.0", + "document-features", + "idna", "log", "publicsuffix", "serde", @@ -2774,7 +2747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2830,7 +2803,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2854,7 +2827,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2865,7 +2838,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -2951,7 +2924,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "validator", @@ -3027,7 +3000,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -3050,7 +3023,16 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", ] [[package]] @@ -3420,7 +3402,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -3575,7 +3557,7 @@ dependencies = [ "getrandom 0.2.15", "gotrue-entity", "infra", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "tokio", @@ -3656,7 +3638,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http 1.2.0", "indexmap 2.3.0", "slab", "tokio", @@ -3685,7 +3667,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -3818,9 +3800,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -3845,7 +3827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -3856,7 +3838,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "pin-project-lite", ] @@ -3934,7 +3916,7 @@ dependencies = [ "futures-channel", "futures-util", "h2 0.4.5", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "httparse", "httpdate", @@ -3968,7 +3950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http 1.1.0", + "http 1.2.0", "hyper 1.4.1", "hyper-util", "rustls 0.23.20", @@ -3992,19 +3974,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.30", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyper-tls" version = "0.6.0" @@ -4030,7 +3999,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", @@ -4178,7 +4147,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -4187,26 +4156,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -4281,7 +4230,7 @@ dependencies = [ "bytes", "futures", "pin-project", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "tokio", @@ -4430,9 +4379,9 @@ dependencies = [ [[package]] name = "lettre" -version = "0.11.7" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a62049a808f1c4e2356a2a380bd5f2aca3b011b0b482cf3b914ba1731426969" +checksum = "ab4c9a167ff73df98a5ecc07e8bf5ce90b583665da3d1762eb1f775ad4d0d6f5" dependencies = [ "async-trait", "base64 0.22.1", @@ -4444,7 +4393,7 @@ dependencies = [ "futures-util", "hostname", "httpdate", - "idna 0.5.0", + "idna", "mime", "native-tls", "nom", @@ -4491,6 +4440,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "local-channel" version = "0.1.5" @@ -4943,7 +4898,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5137,7 +5092,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.63", "ucd-trie", ] @@ -5161,7 +5116,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5263,7 +5218,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5301,7 +5256,7 @@ checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5439,7 +5394,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5493,14 +5448,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -5525,7 +5480,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5565,7 +5520,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.72", + "syn 2.0.90", "tempfile", ] @@ -5586,7 +5541,7 @@ dependencies = [ "prost 0.13.3", "prost-types 0.13.3", "regex", - "syn 2.0.72", + "syn 2.0.90", "tempfile", ] @@ -5600,7 +5555,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5613,7 +5568,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -5721,11 +5676,11 @@ dependencies = [ [[package]] name = "publicsuffix" -version = "2.2.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" +checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" dependencies = [ - "idna 0.3.0", + "idna", "psl-types", ] @@ -5767,7 +5722,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls 0.23.20", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -5784,7 +5739,7 @@ dependencies = [ "rustc-hash", "rustls 0.23.20", "slab", - "thiserror", + "thiserror 1.0.63", "tinyvec", "tracing", ] @@ -6073,78 +6028,30 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "cookie 0.17.0", - "cookie_store 0.20.0", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.30", - "hyper-rustls 0.24.2", - "hyper-tls 0.5.0", - "ipnet", - "js-sys", - "log", - "mime", - "mime_guess", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-rustls 0.24.1", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots 0.25.4", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", "cookie 0.18.1", - "cookie_store 0.21.0", + "cookie_store", "encoding_rs", "futures-core", "futures-util", "h2 0.4.5", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "hyper 1.4.1", "hyper-rustls 0.27.2", - "hyper-tls 0.6.0", + "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", + "mime_guess", "native-tls", "once_cell", "percent-encoding", @@ -6169,7 +6076,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.26.3", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -6209,7 +6116,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6638,7 +6545,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6649,7 +6556,7 @@ checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6691,7 +6598,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -6769,11 +6676,11 @@ dependencies = [ "infra", "log", "pin-project", - "reqwest 0.11.27", + "reqwest", "serde", "serde_json", "serde_repr", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "validator", @@ -6822,7 +6729,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -7003,7 +6910,7 @@ dependencies = [ "sha2", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.63", "tokio", "tokio-stream", "tracing", @@ -7022,7 +6929,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7045,7 +6952,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.72", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -7090,7 +6997,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "whoami", @@ -7131,7 +7038,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", "whoami", @@ -7246,7 +7153,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7268,9 +7175,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -7286,7 +7193,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7300,6 +7207,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -7321,25 +7231,25 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -7395,7 +7305,16 @@ version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.63", +] + +[[package]] +name = "thiserror" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +dependencies = [ + "thiserror-impl 2.0.8", ] [[package]] @@ -7406,7 +7325,18 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -7548,7 +7478,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7631,10 +7561,24 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", - "tungstenite", + "tungstenite 0.20.1", "webpki-roots 0.25.4", ] +[[package]] +name = "tokio-tungstenite" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4bf6fecd69fcdede0ec680aaf474cdab988f9de6bc73d3758f0160e3b7025a" +dependencies = [ + "futures-util", + "log", + "native-tls", + "tokio", + "tokio-native-tls", + "tungstenite 0.26.1", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -7678,7 +7622,7 @@ dependencies = [ "base64 0.22.1", "bytes", "h2 0.4.5", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "hyper 1.4.1", @@ -7707,7 +7651,7 @@ dependencies = [ "prost-build 0.13.3", "prost-types 0.13.3", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7750,7 +7694,7 @@ dependencies = [ "bitflags 2.6.0", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "http-range-header", @@ -7798,7 +7742,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7916,7 +7860,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -7935,11 +7879,30 @@ dependencies = [ "rand 0.8.5", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.63", "url", "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413083a99c579593656008130e29255e54dcaae495be556cc26888f211648c24" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.2.0", + "httparse", + "log", + "native-tls", + "rand 0.8.5", + "sha1", + "thiserror 2.0.8", + "utf-8", +] + [[package]] name = "typenum" version = "1.17.0" @@ -8060,12 +8023,12 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] @@ -8110,7 +8073,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0b4a29d8709210980a09379f27ee31549b73292c87ab9899beee1c0d3be6303" dependencies = [ - "idna 1.0.3", + "idna", "once_cell", "regex", "serde", @@ -8131,7 +8094,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8216,7 +8179,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -8250,7 +8213,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8283,7 +8246,7 @@ checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8416,6 +8379,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -8564,26 +8557,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "workspace-template" version = "0.1.0" @@ -8653,7 +8626,7 @@ dependencies = [ "oid-registry", "ring 0.16.20", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -8710,7 +8683,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "synstructure 0.13.1", ] @@ -8729,7 +8702,7 @@ dependencies = [ "serde_json", "smallstr", "smallvec", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -8759,7 +8732,7 @@ checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8770,7 +8743,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8790,7 +8763,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", "synstructure 0.13.1", ] @@ -8811,7 +8784,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] @@ -8833,7 +8806,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.90", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7ac328d3..2f47d813 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,7 +90,7 @@ async-trait.workspace = true prometheus-client.workspace = true itertools = "0.11" uuid.workspace = true -tokio-tungstenite = { version = "0.20.1", features = ["native-tls"] } +tokio-tungstenite = { version = "0.26.1", features = ["native-tls"] } dotenvy.workspace = true url = "2.5.0" brotli.workspace = true @@ -155,7 +155,7 @@ console-subscriber = { version = "0.4.1", optional = true } base64.workspace = true md5.workspace = true nanoid = "0.4.0" -http = "0.2.12" +http.workspace = true [dev-dependencies] flate2 = "1.0" @@ -268,7 +268,7 @@ sqlx = { version = "0.8.1", default-features = false } dashmap = "5.5.3" futures = "0.3.30" async-stream = "0.3.5" -reqwest = "0.11.27" +reqwest = "0.12.9" lazy_static = "1.4.0" tonic = "0.12.3" prost = "0.13.3" @@ -288,6 +288,8 @@ chrono = { version = "0.4.39", features = [ "serde", "clock", ], default-features = false } +http = "0.2.12" +tokio-tungstenite = "0.20" # collaboration yrs = { version = "0.21.3", features = ["sync"] } @@ -317,13 +319,13 @@ lto = false [patch.crates-io] # It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate. # So using patch to workaround this issue. -collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } -collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } -collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } -collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } -collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } -collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } -collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "2443178e4249354c094867875f300cc924cbe0e2" } +collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } +collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } +collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } +collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } +collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } +collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } +collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "c45a2120361f94bbedb787cdd2192a38c94c7f5f" } [features] history = [] diff --git a/Dockerfile b/Dockerfile index e31bc4ee..42c12d1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Using cargo-chef to manage Rust build cache effectively -FROM lukemathwalker/cargo-chef:latest-rust-1.79 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.81 as chef WORKDIR /app RUN apt update && apt install lld clang -y diff --git a/admin_frontend/Cargo.toml b/admin_frontend/Cargo.toml index 12cb039e..f7300a69 100644 --- a/admin_frontend/Cargo.toml +++ b/admin_frontend/Cargo.toml @@ -26,7 +26,7 @@ redis = { version = "0.25.2", features = [ ] } uuid = { workspace = true, features = ["v4"] } dotenvy = "0.15" -reqwest = "0.11.27" +reqwest.workspace = true tower-service = "0.3" tower-http = { version = "0.5", features = ["fs"] } tower = "0.4" diff --git a/admin_frontend/Dockerfile b/admin_frontend/Dockerfile index 3a2d8e5d..03cabc63 100644 --- a/admin_frontend/Dockerfile +++ b/admin_frontend/Dockerfile @@ -1,6 +1,6 @@ # User should build from parent directory -FROM lukemathwalker/cargo-chef:latest-rust-1.78 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.81 as chef WORKDIR /app diff --git a/libs/appflowy-ai-client/Cargo.toml b/libs/appflowy-ai-client/Cargo.toml index 37ca06b6..5786e842 100644 --- a/libs/appflowy-ai-client/Cargo.toml +++ b/libs/appflowy-ai-client/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.12", features = [ +reqwest = { workspace = true, features = [ "json", "rustls-tls", "cookies", diff --git a/libs/client-api/Cargo.toml b/libs/client-api/Cargo.toml index 873fe39b..49a1e948 100644 --- a/libs/client-api/Cargo.toml +++ b/libs/client-api/Cargo.toml @@ -30,7 +30,7 @@ chrono = "0.4" client-websocket = { workspace = true, features = ["native-tls"] } semver = "1.0.22" zstd = { version = "0.13.2" } - +tokio-tungstenite.workspace = true collab = { workspace = true, optional = true } yrs = { workspace = true, optional = true } diff --git a/libs/client-api/src/retry.rs b/libs/client-api/src/retry.rs index 557b0253..78f81fec 100644 --- a/libs/client-api/src/retry.rs +++ b/libs/client-api/src/retry.rs @@ -7,13 +7,13 @@ use app_error::gotrue::GoTrueError; use client_websocket::{connect_async, WebSocketStream}; use gotrue::grant::{Grant, RefreshTokenGrant}; use parking_lot::RwLock; -use reqwest::header::HeaderMap; use std::future::Future; use std::pin::Pin; use std::sync::{Arc, Weak}; use std::time::Duration; use tokio_retry::strategy::FixedInterval; use tokio_retry::{Action, Condition, RetryIf}; +use tokio_tungstenite::tungstenite::http::HeaderMap; use tracing::{debug, info, trace}; pub(crate) struct RefreshTokenAction { diff --git a/libs/client-api/src/ws/client.rs b/libs/client-api/src/ws/client.rs index 7d3de234..d0df6253 100644 --- a/libs/client-api/src/ws/client.rs +++ b/libs/client-api/src/ws/client.rs @@ -7,11 +7,13 @@ use std::time::Duration; use futures_util::stream::{SplitSink, SplitStream}; use futures_util::{SinkExt, StreamExt}; use parking_lot::RwLock; -use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION}; +// use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION}; use semver::Version; use tokio::sync::broadcast::{channel, Receiver, Sender}; use tokio::sync::oneshot; use tokio::sync::Mutex; +use tokio_tungstenite::tungstenite::http::header::AUTHORIZATION; +use tokio_tungstenite::tungstenite::http::{HeaderMap, HeaderValue}; use tracing::{error, info, trace, warn}; use crate::ping::ServerFixIntervalPing; @@ -493,7 +495,7 @@ impl Display for ConnectInfo { } impl From for HeaderMap { - fn from(info: ConnectInfo) -> Self { + fn from(info: ConnectInfo) -> HeaderMap { let mut headers = HeaderMap::new(); headers.insert( "device-id", diff --git a/libs/client-api/src/ws/error.rs b/libs/client-api/src/ws/error.rs index 40c82925..df276e98 100644 --- a/libs/client-api/src/ws/error.rs +++ b/libs/client-api/src/ws/error.rs @@ -36,7 +36,7 @@ impl From for WSError { Error::Protocol(ProtocolError::SendAfterClosing) => WSError::Close(value.to_string()), Error::Http(resp) => { let status = resp.status(); - if status == StatusCode::UNAUTHORIZED || status == StatusCode::NOT_FOUND { + if status == StatusCode::UNAUTHORIZED.as_u16() || status == StatusCode::NOT_FOUND.as_u16() { WSError::AuthError("Unauthorized websocket connection".to_string()) } else { WSError::TungsteniteError(value) diff --git a/libs/client-websocket/Cargo.toml b/libs/client-websocket/Cargo.toml index b4b98b75..ad5932ce 100644 --- a/libs/client-websocket/Cargo.toml +++ b/libs/client-websocket/Cargo.toml @@ -19,7 +19,6 @@ __rustls-tls = [] [dependencies] thiserror = "1" -http = "0.2" httparse = "1.8" futures-util = { version = "0.3", default-features = false, features = [ "sink", @@ -27,7 +26,7 @@ futures-util = { version = "0.3", default-features = false, features = [ ] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tokio-tungstenite = "0.20" +tokio-tungstenite.workspace = true tokio = { workspace = true, features = ["net"] } [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/libs/client-websocket/src/error.rs b/libs/client-websocket/src/error.rs index 60b2fa72..841105f1 100644 --- a/libs/client-websocket/src/error.rs +++ b/libs/client-websocket/src/error.rs @@ -1,6 +1,7 @@ use http::{header::HeaderName, Response}; use std::{io, result, str, string}; use thiserror::Error; +use tokio_tungstenite::tungstenite::http; /// These error types are copy-pasted from the tokio_tungstenite crate. pub type Result = result::Result; diff --git a/libs/client-websocket/src/lib.rs b/libs/client-websocket/src/lib.rs index 37def120..b069014e 100644 --- a/libs/client-websocket/src/lib.rs +++ b/libs/client-websocket/src/lib.rs @@ -6,12 +6,12 @@ mod native; mod web; pub use error::{Error, ProtocolError, Result}; -use http::HeaderMap; pub use message::coding::*; pub use message::CloseFrame; pub use message::Message; #[cfg(not(target_arch = "wasm32"))] use native as ws; +use tokio_tungstenite::tungstenite::http::HeaderMap; #[cfg(target_arch = "wasm32")] use web as ws; pub use ws::WebSocketStream; diff --git a/libs/client-websocket/src/native.rs b/libs/client-websocket/src/native.rs index 920f6388..0341aaf7 100644 --- a/libs/client-websocket/src/native.rs +++ b/libs/client-websocket/src/native.rs @@ -1,8 +1,8 @@ use futures_util::{Sink, Stream, StreamExt}; -use http::HeaderMap; use std::pin::Pin; use std::task::{Context, Poll}; use tokio_tungstenite::tungstenite::client::IntoClientRequest; +use tokio_tungstenite::tungstenite::http::HeaderMap; use tokio_tungstenite::{ tungstenite::{ error::*, diff --git a/libs/database/src/index/collab_embeddings_ops.rs b/libs/database/src/index/collab_embeddings_ops.rs index 4063699e..c1db9739 100644 --- a/libs/database/src/index/collab_embeddings_ops.rs +++ b/libs/database/src/index/collab_embeddings_ops.rs @@ -1,7 +1,9 @@ use collab_entity::CollabType; +use futures_util::stream::BoxStream; +use futures_util::StreamExt; use pgvector::Vector; use sqlx::postgres::{PgHasArrayType, PgTypeInfo}; -use sqlx::{Error, Executor, Postgres, Transaction}; +use sqlx::{Error, Executor, PgPool, Postgres, Transaction}; use std::ops::DerefMut; use uuid::Uuid; @@ -109,35 +111,29 @@ pub async fn upsert_collab_embeddings( Ok(()) } -pub async fn get_collabs_without_embeddings<'a, E>( - executor: E, -) -> Result, sqlx::Error> -where - E: Executor<'a, Database = Postgres>, -{ - let oids = sqlx::query!( +pub fn get_collabs_without_embeddings(pg_pool: &PgPool) -> BoxStream> { + // atm. get only documents + sqlx::query!( r#" - select c.workspace_id, c.oid, c.partition_key - from af_collab c - join af_workspace w on c.workspace_id = w.workspace_id - where not coalesce(w.settings['disable_search_indexding']::boolean, false) - and not exists ( - select 1 - from af_collab_embeddings em - where em.oid = c.oid and em.partition_key = 0)"# // atm. get only documents - ) - .fetch_all(executor) - .await?; - Ok( - oids - .into_iter() - .map(|r| CollabId { - collab_type: CollabType::from(r.partition_key), - workspace_id: r.workspace_id, - object_id: r.oid, - }) - .collect(), + select c.workspace_id, c.oid, c.partition_key + from af_collab c + join af_workspace w on c.workspace_id = w.workspace_id + where not coalesce(w.settings['disable_search_indexding']::boolean, false) + and not exists ( + select 1 from af_collab_embeddings em + where em.oid = c.oid and em.partition_key = 0 + ) + "# ) + .fetch(pg_pool) + .map(|row| { + row.map(|r| CollabId { + collab_type: CollabType::from(r.partition_key), + workspace_id: r.workspace_id, + object_id: r.oid, + }) + }) + .boxed() } #[derive(Debug, Clone)] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4d2dee85..1de01fa4 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.0" +channel = "1.81.0" diff --git a/script/client_api_deps_check.sh b/script/client_api_deps_check.sh index 0c6b1e99..b8e507db 100755 --- a/script/client_api_deps_check.sh +++ b/script/client_api_deps_check.sh @@ -3,7 +3,7 @@ # Generate the current dependency list cargo tree > current_deps.txt -BASELINE_COUNT=722 +BASELINE_COUNT=747 CURRENT_COUNT=$(cat current_deps.txt | wc -l) echo "Expected dependency count (baseline): $BASELINE_COUNT" diff --git a/services/appflowy-collaborate/Dockerfile b/services/appflowy-collaborate/Dockerfile index 2c958002..7768490d 100644 --- a/services/appflowy-collaborate/Dockerfile +++ b/services/appflowy-collaborate/Dockerfile @@ -1,5 +1,5 @@ # Using cargo-chef to manage Rust build cache effectively -FROM lukemathwalker/cargo-chef:latest-rust-1.78 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.81 as chef WORKDIR /app RUN apt update && apt install lld clang -y diff --git a/services/appflowy-collaborate/src/indexer/indexer_scheduler.rs b/services/appflowy-collaborate/src/indexer/indexer_scheduler.rs index aff43acf..f6b03a21 100644 --- a/services/appflowy-collaborate/src/indexer/indexer_scheduler.rs +++ b/services/appflowy-collaborate/src/indexer/indexer_scheduler.rs @@ -4,11 +4,9 @@ use crate::indexer::vector::embedder::Embedder; use crate::indexer::vector::open_ai; use crate::indexer::{Indexer, IndexerProvider}; use crate::thread_pool_no_abort::{ThreadPoolNoAbort, ThreadPoolNoAbortBuilder}; -use actix::dev::Stream; use anyhow::anyhow; use app_error::AppError; use appflowy_ai_client::dto::{EmbeddingRequest, OpenAIEmbeddingResponse}; -use async_stream::try_stream; use bytes::Bytes; use collab::core::collab::DataSource; use collab::core::origin::CollabOrigin; @@ -20,10 +18,10 @@ use database::collab::{CollabStorage, GetCollabOrigin}; use database::index::{get_collabs_without_embeddings, upsert_collab_embeddings}; use database::workspace::select_workspace_settings; use database_entity::dto::{AFCollabEmbeddedChunk, CollabParams}; +use futures_util::stream::BoxStream; use futures_util::StreamExt; use rayon::prelude::*; use sqlx::PgPool; -use std::pin::Pin; use std::sync::Arc; use std::time::{Duration, Instant}; use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}; @@ -34,6 +32,7 @@ use uuid::Uuid; pub struct IndexerScheduler { indexer_provider: Arc, pg_pool: PgPool, + #[allow(dead_code)] storage: Arc, threads: Arc, #[allow(dead_code)] @@ -108,7 +107,7 @@ impl IndexerScheduler { this.pg_pool.clone(), this.metrics.clone(), )); - tokio::spawn(handle_unindexed_collabs(this.clone())); + // tokio::spawn(handle_unindexed_collabs(this.clone())); } this @@ -395,12 +394,13 @@ fn should_embed( should_embed } +#[allow(dead_code)] async fn handle_unindexed_collabs(scheduler: Arc) { // wait for 30 seconds before starting indexing tokio::time::sleep(tokio::time::Duration::from_secs(30)).await; let mut i = 0; - let mut stream = get_unindexed_collabs(&scheduler.pg_pool, scheduler.storage.clone()); + let mut stream = get_unindexed_collabs(&scheduler.pg_pool, scheduler.storage.clone()).await; let record_tx = scheduler.schedule_tx.clone(); let start = Instant::now(); while let Some(result) = stream.next().await { @@ -439,41 +439,46 @@ async fn handle_unindexed_collabs(scheduler: Arc) { ) } -fn get_unindexed_collabs( +pub async fn get_unindexed_collabs( pg_pool: &PgPool, storage: Arc, -) -> Pin> + Send>> { - let db = pg_pool.clone(); - Box::pin(try_stream! { - let collabs = get_collabs_without_embeddings(&db).await?; - if !collabs.is_empty() { - info!("found {} unindexed collabs", collabs.len()); - } - for cid in collabs { - match &cid.collab_type { - CollabType::Document => { - let collab = storage - .get_encode_collab(GetCollabOrigin::Server, cid.clone().into(), false) - .await?; +) -> BoxStream> { + let cloned_storage = storage.clone(); + get_collabs_without_embeddings(pg_pool) + .map(move |result| { + let storage = cloned_storage.clone(); + async move { + match result { + Ok(cid) => match cid.collab_type { + CollabType::Document => { + let collab = storage + .get_encode_collab(GetCollabOrigin::Server, cid.clone().into(), false) + .await?; - yield UnindexedCollab { - workspace_id: cid.workspace_id, - object_id: cid.object_id, - collab_type: cid.collab_type, - collab, - }; - }, - CollabType::Database - | CollabType::WorkspaceDatabase - | CollabType::Folder - | CollabType::DatabaseRow - | CollabType::UserAwareness - | CollabType::Unknown => { /* atm. only document types are supported */ }, + Ok(Some(UnindexedCollab { + workspace_id: cid.workspace_id, + object_id: cid.object_id, + collab_type: cid.collab_type, + collab, + })) + }, + _ => Ok::<_, anyhow::Error>(None), + }, + Err(e) => Err(e.into()), + } } - } - }) + }) + .filter_map(|future| async { + match future.await { + Ok(Some(unindexed_collab)) => Some(Ok(unindexed_collab)), + Ok(None) => None, + Err(e) => Some(Err(e)), + } + }) + .boxed() } +#[allow(dead_code)] async fn index_unindexd_collab( embedder: Embedder, indexer_provider: &Arc, diff --git a/services/appflowy-history_deprecated/Dockerfile b/services/appflowy-history_deprecated/Dockerfile index d2bc80d1..90149443 100644 --- a/services/appflowy-history_deprecated/Dockerfile +++ b/services/appflowy-history_deprecated/Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.77 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.81 as chef # Set the initial working directory WORKDIR /app diff --git a/services/appflowy-worker/Cargo.toml b/services/appflowy-worker/Cargo.toml index 09e798b4..63bbf808 100644 --- a/services/appflowy-worker/Cargo.toml +++ b/services/appflowy-worker/Cargo.toml @@ -61,5 +61,5 @@ mailer.workspace = true md5.workspace = true base64.workspace = true prometheus-client = "0.22.3" -reqwest = "0.12.5" +reqwest.workspace = true zstd.workspace = true diff --git a/services/appflowy-worker/Dockerfile b/services/appflowy-worker/Dockerfile index 56cf8f63..08584113 100644 --- a/services/appflowy-worker/Dockerfile +++ b/services/appflowy-worker/Dockerfile @@ -1,4 +1,4 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.78 as chef +FROM lukemathwalker/cargo-chef:latest-rust-1.81 as chef # Set the initial working directory WORKDIR /app diff --git a/src/api/template.rs b/src/api/template.rs index 3eb4ff49..f342af85 100644 --- a/src/api/template.rs +++ b/src/api/template.rs @@ -1,4 +1,5 @@ use actix_multipart::form::{bytes::Bytes as MPBytes, MultipartForm}; +use actix_web::http::StatusCode; use actix_web::{ web::{self, Data, Json}, HttpResponse, Result, Scope, @@ -11,7 +12,6 @@ use database_entity::dto::{ TemplateCreators, TemplateHomePage, TemplateHomePageQueryParams, TemplateWithPublishInfo, Templates, UpdateTemplateCategoryParams, UpdateTemplateCreatorParams, UpdateTemplateParams, }; -use reqwest::StatusCode; use shared_entity::response::{AppResponse, JsonAppResponse}; use uuid::Uuid; diff --git a/src/api/workspace.rs b/src/api/workspace.rs index 5bf55b10..6d6f8e77 100644 --- a/src/api/workspace.rs +++ b/src/api/workspace.rs @@ -836,25 +836,23 @@ async fn batch_create_collab_handler( start.elapsed() ); - if state - .indexer_scheduler - .can_index_workspace(&workspace_id) - .await? - { - let indexed_collabs: Vec<_> = collab_params_list - .iter() - .filter(|p| state.indexer_scheduler.is_indexing_enabled(&p.collab_type)) - .map(IndexedCollab::from) - .collect(); - - if !indexed_collabs.is_empty() { - let len = indexed_collabs.len(); - state - .indexer_scheduler - .index_encoded_collabs(&workspace_id, indexed_collabs)?; - tracing::info!("scheduled indexing for {} collabs", len); - } - } + // if state + // .indexer_scheduler + // .can_index_workspace(&workspace_id) + // .await? + // { + // let indexed_collabs: Vec<_> = collab_params_list + // .iter() + // .filter(|p| state.indexer_scheduler.is_indexing_enabled(&p.collab_type)) + // .map(IndexedCollab::from) + // .collect(); + // + // if !indexed_collabs.is_empty() { + // state + // .indexer_scheduler + // .index_encoded_collabs(&workspace_id, indexed_collabs)?; + // } + // } let start = Instant::now(); state