Update reconcile to 0.8.0

This commit is contained in:
Andras Schmelczer 2025-12-06 22:20:31 +00:00
parent 2885026d2f
commit aca1ca50a4
8 changed files with 36 additions and 30 deletions

View file

@ -20,7 +20,7 @@
"fs-extra": "^11.3.0",
"mini-css-extract-plugin": "^2.9.2",
"obsidian": "1.10.2",
"reconcile-text": "^0.7.1",
"reconcile-text": "^0.8.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.91.0",
"sass-loader": "^16.0.6",

View file

@ -3486,9 +3486,9 @@
}
},
"node_modules/reconcile-text": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/reconcile-text/-/reconcile-text-0.7.1.tgz",
"integrity": "sha512-khedcYvAKs7ELKh5Z8mz2vyomMY5TqznV1dB+k/7qUAX9cheMNN5/EPJVQYZepOMunYbnQitvhFJX3kD4IMcNw==",
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/reconcile-text/-/reconcile-text-0.8.0.tgz",
"integrity": "sha512-evskVha3YgpP2ZelsFxP9t7CuKnwE7TrsH3FdrH2mfKbzjUWiNF7scHXsFbFS921lmFlAOB94DHNAWPvL34Mqg==",
"dev": true,
"license": "MIT"
},
@ -4656,7 +4656,7 @@
"fs-extra": "^11.3.0",
"mini-css-extract-plugin": "^2.9.2",
"obsidian": "1.10.2",
"reconcile-text": "^0.7.1",
"reconcile-text": "^0.8.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.91.0",
"sass-loader": "^16.0.6",
@ -4679,7 +4679,7 @@
"byte-base64": "^1.1.0",
"minimatch": "^10.0.1",
"p-queue": "^8.1.0",
"reconcile-text": "^0.7.1",
"reconcile-text": "^0.8.0",
"ts-loader": "^9.5.2",
"tslib": "2.8.1",
"tsx": "^4.20.6",

View file

@ -16,7 +16,7 @@
"byte-base64": "^1.1.0",
"minimatch": "^10.0.1",
"p-queue": "^8.1.0",
"reconcile-text": "^0.7.1",
"reconcile-text": "^0.8.0",
"uuid": "^13.0.0",
"@types/node": "^24.8.1",
"ts-loader": "^9.5.2",

View file

@ -26,7 +26,12 @@ cargo machete --with-metadata
echo "Running checks in frontend"
cd ../frontend
npm ci
if [[ "$FIX_MODE" == true ]]; then
npm install
else
npm ci
fi
npm run build
npm run test
npm run lint
@ -37,7 +42,6 @@ if [[ "$FIX_MODE" == false ]] && [[ $(git status --porcelain) ]]; then
exit 1
fi
cd ..
if [[ "$FIX_MODE" == true ]]; then
@ -45,4 +49,3 @@ if [[ "$FIX_MODE" == true ]]; then
else
echo "Success"
fi

27
sync-server/Cargo.lock generated
View file

@ -1592,11 +1592,12 @@ dependencies = [
[[package]]
name = "reconcile-text"
version = "0.7.1"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "913440a3c2b90cd3ed3e967660f2bb624b71e8059b9fc86960a5f91bd1e2e353"
checksum = "599cf9539996a2a19e501110404c59ba62f4974009f8fb864a8b7151c15ee5a5"
dependencies = [
"serde",
"thiserror 2.0.17",
]
[[package]]
@ -1925,7 +1926,7 @@ dependencies = [
"serde_json",
"sha2",
"smallvec",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tokio-stream",
"tracing",
@ -2009,7 +2010,7 @@ dependencies = [
"smallvec",
"sqlx-core",
"stringprep",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
"uuid",
"whoami",
@ -2048,7 +2049,7 @@ dependencies = [
"smallvec",
"sqlx-core",
"stringprep",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
"uuid",
"whoami",
@ -2074,7 +2075,7 @@ dependencies = [
"serde",
"serde_urlencoded",
"sqlx-core",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
"url",
"uuid",
@ -2154,7 +2155,7 @@ dependencies = [
"serde_json",
"serde_yaml",
"sqlx",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tower-http",
"tracing",
@ -2213,11 +2214,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.12"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
dependencies = [
"thiserror-impl 2.0.12",
"thiserror-impl 2.0.17",
]
[[package]]
@ -2233,9 +2234,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.12"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
dependencies = [
"proc-macro2",
"quote",
@ -2444,7 +2445,7 @@ checksum = "e640d9b0964e9d39df633548591090ab92f7a4567bc31d3891af23471a3365c6"
dependencies = [
"chrono",
"lazy_static",
"thiserror 2.0.12",
"thiserror 2.0.17",
"ts-rs-macros",
"uuid",
]

View file

@ -34,7 +34,7 @@ clap-verbosity-flag = "3.0.3"
bimap = "0.6.3"
ts-rs = { version = "10.1", features = ["uuid-impl", "chrono-impl"] }
base64 = "0.22.1"
reconcile-text = { version = "0.7.1", features = ["serde"] }
reconcile-text = { version = "0.8.0", features = ["serde"] }
[profile.release]
codegen-units = 1

View file

@ -1,6 +1,6 @@
use axum::body::Bytes;
use axum_typed_multipart::{FieldData, TryFromMultipart};
use reconcile_text::NumberOrString;
use reconcile_text::NumberOrText;
use serde::{self, Deserialize};
use ts_rs::TS;
@ -40,7 +40,7 @@ pub struct UpdateTextDocumentVersion {
pub relative_path: String,
#[ts(type = "Array<number | string>")]
pub content: Vec<NumberOrString>,
pub content: Vec<NumberOrText>,
}
#[derive(TS, Debug, Deserialize)]

View file

@ -19,7 +19,7 @@ use crate::{
database::models::{DocumentId, StoredDocumentVersion, VaultId, VaultUpdateId},
},
config::user_config::User,
errors::{SyncServerError, not_found_error, server_error},
errors::{SyncServerError, client_error, not_found_error, server_error},
server::requests::UpdateBinaryDocumentVersion,
utils::{
find_first_available_path::find_first_available_path, is_binary::is_binary,
@ -81,7 +81,9 @@ pub async fn update_text(
.expect("parent must be valid UTF-8 because it's a text document"),
request.content,
&*BuiltinTokenizer::Word,
);
)
.context("Failed to apply given diff to parent document")
.map_err(client_error)?;
let content = edited_text.apply().text().into_bytes();