diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-06-30 22:00:57 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-07-03 22:43:42 -0400 |
| commit | a15e3d580124f561864c6a39f1e035eb1b3aab13 (patch) | |
| tree | ef80f725e7b02547a23b5c29a482fbf3fd188c0d /src/event/handlers/stream/test/resume.rs | |
| parent | 5af4aea1e2f143499529b70f9cf191c6994265c6 (diff) | |
Rename "channel" to "conversation" within the server.
I've split this from the schema and API changes because, frankly, it's huge. Annoyingly so. There are no semantic changes in this, it's all symbol changes, but there are a _lot_ of them because the term "channel" leaks all over everything in a service whose primary role is managing messages sent to channels (now, conversations).
I found a buggy test while working on this! It's not fixed in this commit, because it felt mean to hide a real change in the middle of this much chaff.
Diffstat (limited to 'src/event/handlers/stream/test/resume.rs')
| -rw-r--r-- | src/event/handlers/stream/test/resume.rs | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/event/handlers/stream/test/resume.rs b/src/event/handlers/stream/test/resume.rs index 835d350..a0da692 100644 --- a/src/event/handlers/stream/test/resume.rs +++ b/src/event/handlers/stream/test/resume.rs @@ -14,15 +14,16 @@ async fn resume() { // Set up the environment let app = fixtures::scratch_app().await; - let channel = fixtures::channel::create(&app, &fixtures::now()).await; + let conversation = fixtures::conversation::create(&app, &fixtures::now()).await; let sender = fixtures::user::create(&app, &fixtures::now()).await; let resume_point = fixtures::boot::resume_point(&app).await; - let initial_message = fixtures::message::send(&app, &channel, &sender, &fixtures::now()).await; + let initial_message = + fixtures::message::send(&app, &conversation, &sender, &fixtures::now()).await; let later_messages = vec![ - fixtures::message::send(&app, &channel, &sender, &fixtures::now()).await, - fixtures::message::send(&app, &channel, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation, &sender, &fixtures::now()).await, ]; // Call the endpoint @@ -75,8 +76,8 @@ async fn resume() { // This test verifies a real bug I hit developing the vector-of-sequences // approach to resuming events. A small omission caused the event IDs in a -// resumed stream to _omit_ channels that were in the original stream until -// those channels also appeared in the resumed stream. +// resumed stream to _omit_ conversations that were in the original stream +// until those conversations also appeared in the resumed stream. // // Clients would see something like // * In the original stream, Cfoo=5,Cbar=8 @@ -84,8 +85,8 @@ async fn resume() { // // Disconnecting and reconnecting a second time, using event IDs from that // initial period of the first resume attempt, would then cause the second -// resume attempt to restart all other channels from the beginning, and not -// from where the first disconnection happened. +// resume attempt to restart all other conversations from the beginning, and +// not from where the first disconnection happened. // // As we have switched to a single global event sequence number, this scenario // can no longer arise, but this test is preserved because the actual behaviour @@ -97,8 +98,8 @@ async fn serial_resume() { let app = fixtures::scratch_app().await; let sender = fixtures::user::create(&app, &fixtures::now()).await; - let channel_a = fixtures::channel::create(&app, &fixtures::now()).await; - let channel_b = fixtures::channel::create(&app, &fixtures::now()).await; + let conversation_a = fixtures::conversation::create(&app, &fixtures::now()).await; + let conversation_b = fixtures::conversation::create(&app, &fixtures::now()).await; let resume_point = fixtures::boot::resume_point(&app).await; // Call the endpoint @@ -107,8 +108,8 @@ async fn serial_resume() { let resume_at = { let initial_messages = [ - fixtures::message::send(&app, &channel_a, &sender, &fixtures::now()).await, - fixtures::message::send(&app, &channel_b, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation_a, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation_b, &sender, &fixtures::now()).await, ]; // First subscription @@ -148,11 +149,11 @@ async fn serial_resume() { // Resume after disconnect let resume_at = { let resume_messages = [ - // Note that channel_b does not appear here. The buggy behaviour - // would be masked if channel_b happened to send a new message + // Note that conversation_b does not appear here. The buggy behaviour + // would be masked if conversation_b happened to send a new message // into the resumed event stream. - fixtures::message::send(&app, &channel_a, &sender, &fixtures::now()).await, - fixtures::message::send(&app, &channel_a, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation_a, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation_a, &sender, &fixtures::now()).await, ]; // Second subscription @@ -190,12 +191,12 @@ async fn serial_resume() { // Resume after disconnect a second time { - // At this point, we can send on either channel and demonstrate the - // problem. The resume point should before both of these messages, but - // after _all_ prior messages. + // At this point, we can send on either conversation and demonstrate + // the problem. The resume point should before both of these messages, + // but after _all_ prior messages. let final_messages = [ - fixtures::message::send(&app, &channel_a, &sender, &fixtures::now()).await, - fixtures::message::send(&app, &channel_b, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation_a, &sender, &fixtures::now()).await, + fixtures::message::send(&app, &conversation_b, &sender, &fixtures::now()).await, ]; // Third subscription |
