fix(release): restore canonical local gate
req: public_api/001 req: v1_release/007
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#[hemx::surface]
|
||||
pub mod ui {}
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
use hemx_sync::SyncEffect as DurableSync;
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
struct CardId(String);
|
||||
@@ -87,15 +90,15 @@ pub fn reorder_card(
|
||||
Some(before) => ui::client_board::client_cards.move_before(card.clone(), before.0),
|
||||
None => ui::client_board::client_cards.move_to_end(card.clone()),
|
||||
};
|
||||
let projection = hemx::IntoEffect::into_batch(
|
||||
DurableSync::durable(
|
||||
patch,
|
||||
(
|
||||
move_effect,
|
||||
ui::client_board::client_notice
|
||||
.text(format!("Moved {card} with {}", projected.input_kind)),
|
||||
),
|
||||
ui::BUILD_FINGERPRINT,
|
||||
);
|
||||
hemx_sync::SyncEffect::durable(patch, projection)
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "client"))]
|
||||
@@ -118,9 +121,10 @@ mod client_tests {
|
||||
)
|
||||
.into_batch(ui::BUILD_FINGERPRINT);
|
||||
assert_eq!(batch.ops.len(), 3);
|
||||
assert!(
|
||||
matches!(&batch.ops[2], hemx::advanced::Effect::Emit { name, payload } if name == hemx_sync::PATCH_EVENT && payload.contains("$hemx-interaction") && payload.contains("\"projection\":["))
|
||||
);
|
||||
let wire = String::from_utf8_lossy(&batch.to_wire()).into_owned();
|
||||
assert!(wire.contains(hemx_sync::PATCH_EVENT));
|
||||
assert!(wire.contains("$hemx-interaction"));
|
||||
assert!(wire.contains("\"projection\":["));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@ use hemx_axum::{
|
||||
use hemx_kanban_example::ui::board::{self as board};
|
||||
use hemx_kanban_example::ui::board_card as card_board;
|
||||
use hemx_kanban_example::ui::{self, board as board_ui};
|
||||
use hemx_sync::{Channel, PresenceScope, PresenceTracker, PresenceUpdate, SyncEffect};
|
||||
use hemx_sync::{
|
||||
Channel, PresenceScope, PresenceTracker, PresenceUpdate, SyncEffect as FrameworkSync,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::BTreeMap;
|
||||
use std::convert::Infallible;
|
||||
@@ -663,7 +665,7 @@ async fn sync_ack(
|
||||
acknowledgement.clone()
|
||||
};
|
||||
let batch = (
|
||||
SyncEffect::ack(board::atoms::sync_ack),
|
||||
FrameworkSync::ack(board::atoms::sync_ack),
|
||||
board::sync_status.text(format!(
|
||||
"Canonical acknowledgement {} at server sequence {}",
|
||||
acknowledgement.command_id, acknowledgement.server_sequence
|
||||
|
||||
Reference in New Issue
Block a user