Validate Poke drafts and keep them editable until acknowledgement

This commit is contained in:
omar committed 2026-11-27 15:22:07 +03:00
1 parent 256e10a9c1
commit 62bb67b5a3
16 files changed
+508 -54

No files matched your search

+12
View File
@@ -357,6 +357,18 @@ fn status_messages_are_optional_but_must_be_valid_when_present() {
core.shutdown();
}
#[test]
fn poke_validates_utf8_bytes_before_connection_lookup() {
let dir = TempDir::new("poke-args"); let mut core = Core::start(&dir.0);
let exact = "\u{10000}".repeat(256);
for (message, expected) in [(String::new(),"bad_request"),(format!("{exact}x"),"bad_request"),
("no\nline".into(),"bad_request"),("no\u{7f}del".into(),"bad_request"),(exact,"not_connected")] {
let (reply,_) = core.request("poke", "client_action", json!({"client_id":2,"uid":"peer=","generation":1,"action":"poke","message":message}));
assert_eq!(reply["error"]["code"],expected,"{reply}");
}
core.shutdown();
}
#[test]
fn client_info_requires_explicit_client_identity() {
let dir = TempDir::new("client-info-args"); let mut core = Core::start(&dir.0);