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\":["));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user