mirror of
https://github.com/logos-messaging/logos-delivery-rust-bindings.git
synced 2026-07-29 22:43:34 +00:00
feat(channels): expose channelExists through the bindings
Bumps vendor to pick up channelExists, cherry-picked onto the nim-ffi
0.2.0 lineage: the chore/channel-exists branch forked before that
migration, so its pre-0.2.0 {.ffi.} shape would not compile here.
The typed model carries a real bool, so channel_exists_async returns
Result<bool, _> rather than the "true"/"false" string the original
would have produced.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
6d56b9b523
commit
fec1784ad5
2
vendor
2
vendor
@ -1 +1 @@
|
||||
Subproject commit 0291318c95cfe6640ff2928f7cf5f2ff360d3673
|
||||
Subproject commit f332c130ed45f4766f6c9b5eb66e2f22f3145fe6
|
||||
@ -73,6 +73,14 @@ async fn channel_create_send_close() {
|
||||
|
||||
node.start_node_async().await.expect("node should start");
|
||||
|
||||
assert!(
|
||||
!node
|
||||
.channel_exists_async(TEST_CHANNEL_ID.to_string())
|
||||
.await
|
||||
.expect("exists should answer for an unknown channel"),
|
||||
"channel should not exist before it is created"
|
||||
);
|
||||
|
||||
let channel_id = node
|
||||
.channel_create_async(
|
||||
TEST_CHANNEL_ID.to_string(),
|
||||
@ -84,6 +92,13 @@ async fn channel_create_send_close() {
|
||||
.expect("channel should be created");
|
||||
assert_eq!(channel_id, TEST_CHANNEL_ID);
|
||||
|
||||
assert!(
|
||||
node.channel_exists_async(TEST_CHANNEL_ID.to_string())
|
||||
.await
|
||||
.expect("exists should answer after create"),
|
||||
"channel should exist once created"
|
||||
);
|
||||
|
||||
let request_id = node
|
||||
.channel_send_async(TEST_CHANNEL_ID.to_string(), channel_message(CHANNEL_PAYLOAD))
|
||||
.await
|
||||
@ -97,6 +112,16 @@ async fn channel_create_send_close() {
|
||||
.await
|
||||
.expect("channel should close");
|
||||
|
||||
// Closing drops the channel from the manager even though its SDS state is
|
||||
// persisted, so this is a liveness check rather than "was it ever created".
|
||||
assert!(
|
||||
!node
|
||||
.channel_exists_async(TEST_CHANNEL_ID.to_string())
|
||||
.await
|
||||
.expect("exists should answer after close"),
|
||||
"channel should not exist once closed"
|
||||
);
|
||||
|
||||
// Scoped so the guard is dropped before the await below. Nothing is asserted
|
||||
// about arrival: a lone node has no peer to confirm delivery with, so
|
||||
// onChannelMessageSent legitimately never fires. Delivery is covered by
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user