diff --git a/Cargo.toml b/Cargo.toml index b8e1ae3..1024dd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ resolver = "3" [workspace.package] # TODO: idk how to do the name, fix later # name = "komp_ac" -version = "0.8.25" +version = "0.8.26" edition = "2024" license = "GPL-3.0-or-later" authors = ["Filip Priečinský "] diff --git a/client b/client index d0bd9dc..de40eb9 160000 --- a/client +++ b/client @@ -1 +1 @@ -Subproject commit d0bd9dce45c71ea7590a77b7b3d7d456161eae7b +Subproject commit de40eb9a39385e105c4fe09531223f10a65ad1d0 diff --git a/common/proto/tables_data.proto b/common/proto/tables_data.proto index 4d37972..4145d6f 100644 --- a/common/proto/tables_data.proto +++ b/common/proto/tables_data.proto @@ -136,6 +136,9 @@ message PostTableDataResponse { // Rows whose stored script values changed through dependency propagation. repeated RecomputedRow recomputed_rows = 4; + + // Revision committed for the inserted row. + int64 row_revision = 5; } // One row in a bulk insert request. @@ -190,6 +193,9 @@ message PutTableDataRequest { // // Passing an empty map results in a no-op success response. map data = 4; + + // Required. Revision returned when this row was loaded or last saved. + int64 expected_revision = 5; } // Update response. @@ -205,6 +211,9 @@ message PutTableDataResponse { // Rows whose stored script values changed through dependency propagation. repeated RecomputedRow recomputed_rows = 4; + + // Revision committed for the updated row. + int64 row_revision = 5; } message RecomputedRow { @@ -223,6 +232,9 @@ message DeleteTableDataRequest { // Required. Row id to soft-delete. int64 record_id = 3; + + // Required. Revision returned when this row was loaded or last saved. + int64 expected_revision = 4; } // Soft-delete response. diff --git a/common/src/grpc_error.rs b/common/src/grpc_error.rs index b43f69d..0a905df 100644 --- a/common/src/grpc_error.rs +++ b/common/src/grpc_error.rs @@ -1,6 +1,4 @@ pub const ERROR_REASON_METADATA_KEY: &str = "komp-ac-error-reason"; -pub const EXPECTED_ROW_REVISION_METADATA_KEY: &str = "komp-ac-expected-row-revision"; -pub const ROW_REVISION_METADATA_KEY: &str = "komp-ac-row-revision"; pub const COMPUTED_VALUE_MISMATCH_REASON: &str = "computed-value-mismatch"; pub const ROW_STALE_REASON: &str = "row-stale"; pub const ROW_ID_CONFLICT_REASON: &str = "row-id-conflict"; diff --git a/common/src/proto/descriptor.bin b/common/src/proto/descriptor.bin index 0ee5c07..7c46e25 100644 Binary files a/common/src/proto/descriptor.bin and b/common/src/proto/descriptor.bin differ diff --git a/common/src/proto/komp_ac.tables_data.rs b/common/src/proto/komp_ac.tables_data.rs index 34f764f..0bf47fa 100644 --- a/common/src/proto/komp_ac.tables_data.rs +++ b/common/src/proto/komp_ac.tables_data.rs @@ -61,6 +61,9 @@ pub struct PostTableDataResponse { /// Rows whose stored script values changed through dependency propagation. #[prost(message, repeated, tag = "4")] pub recomputed_rows: ::prost::alloc::vec::Vec, + /// Revision committed for the inserted row. + #[prost(int64, tag = "5")] + pub row_revision: i64, } /// One row in a bulk insert request. #[derive(Clone, PartialEq, ::prost::Message)] @@ -126,6 +129,9 @@ pub struct PutTableDataRequest { ::prost::alloc::string::String, ::prost_types::Value, >, + /// Required. Revision returned when this row was loaded or last saved. + #[prost(int64, tag = "5")] + pub expected_revision: i64, } /// Update response. #[derive(Clone, PartialEq, ::prost::Message)] @@ -142,6 +148,9 @@ pub struct PutTableDataResponse { /// Rows whose stored script values changed through dependency propagation. #[prost(message, repeated, tag = "4")] pub recomputed_rows: ::prost::alloc::vec::Vec, + /// Revision committed for the updated row. + #[prost(int64, tag = "5")] + pub row_revision: i64, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecomputedRow { @@ -164,6 +173,9 @@ pub struct DeleteTableDataRequest { /// Required. Row id to soft-delete. #[prost(int64, tag = "3")] pub record_id: i64, + /// Required. Revision returned when this row was loaded or last saved. + #[prost(int64, tag = "4")] + pub expected_revision: i64, } /// Soft-delete response. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/server b/server index 3fef1db..86edb1c 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 3fef1dbed56512f336626b10979efa6f7d97ab11 +Subproject commit 86edb1ce08134d4b0dc2ace015ae43e216788291