summaryrefslogtreecommitdiff
path: root/src/event/handlers/stream/test/resume.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/event/handlers/stream/test/resume.rs')
-rw-r--r--src/event/handlers/stream/test/resume.rs43
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