diff options
| author | ojacobson <ojacobson@noreply.codeberg.org> | 2025-07-04 05:00:21 +0200 |
|---|---|---|
| committer | ojacobson <ojacobson@noreply.codeberg.org> | 2025-07-04 05:00:21 +0200 |
| commit | c35be3ae29e77983f013c01260dda20208175f2b (patch) | |
| tree | abf0b9d993ef03a53903aae03f375b78473952da /src/test | |
| parent | 981cd3c0f4cf912c1d91ee5d9c39f5c1aa7afecf (diff) | |
| parent | 9b38cb1a62ede4900fde4ba47a7b065db329e994 (diff) | |
Rename "channels" to "conversations."
The term "channel" for a conversational container has a long and storied history, but is mostly evocative of IRC and of other, ah, "nerd-centric" services. It does show up in more widespread contexts: Discord and Slack both refer to their primary conversational containers as "channels," for example. However, I think it's unnecessary jargon, and I'd like to do away with it.
To that end, this change pervasively changes one term to the other wherever it appears, with the following exceptions:
* A `channel` concept (unrelated to conversations) is also provided by an external library; we can't and shouldn't try to rename that.
* The code to deal with the `pilcrow:channelData` and `pilcrow:lastActiveChannel` local storage properties is still present, to migrate existing data to new keys. It will be removed in a later change.
This is a **breaking API change**. As we are not yet managing any API compatibility promises, this is formally not an issue, but it is something to be aware of practically. The major API changes are:
* Paths beginning with `/api/channels` are now under `/api/conversations`, without other modifications.
* Fields labelled with `channel…` terms are now labelled with `conversation…` terms. For example, a `message` `sent` event is now sent to a `conversation`, not a `channel`.
This is also a **breaking UI change**. Specifically, any saved paths for `/ch/CHANNELID` will now lead to a 404. The corresponding paths are `/c/CONVERSATIONID`. While I've made an effort to migrate the location of stored data, I have not tried to provide adapters to fix this specific issue, because the disruption is short-lived and very easily addressed by opening a channel in the client UI.
This change is obnoxiously large and difficult to review, for which I apologize. If this shows up in `git annotate`, please forgive me. These kinds of renamings are hard to carry out without a major disruption, especially when the concept ("channel" in this case) is used so pervasively throughout the system.
I think it's worth making this change that pervasively so that we don't have an indefinitely-long tail of "well, it's a conversation in the docs, but the table is called `channel` for historical reasons" type issues.
Merges conversations-not-channels into main.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/fixtures/conversation.rs (renamed from src/test/fixtures/channel.rs) | 12 | ||||
| -rw-r--r-- | src/test/fixtures/event/mod.rs | 8 | ||||
| -rw-r--r-- | src/test/fixtures/event/stream.rs | 14 | ||||
| -rw-r--r-- | src/test/fixtures/message.rs | 13 | ||||
| -rw-r--r-- | src/test/fixtures/mod.rs | 2 |
5 files changed, 27 insertions, 22 deletions
diff --git a/src/test/fixtures/channel.rs b/src/test/fixtures/conversation.rs index 98048f2..fb2f58d 100644 --- a/src/test/fixtures/channel.rs +++ b/src/test/fixtures/conversation.rs @@ -7,17 +7,17 @@ use rand; use crate::{ app::App, - channel::{self, Channel}, clock::RequestedAt, + conversation::{self, Conversation}, name::Name, }; -pub async fn create(app: &App, created_at: &RequestedAt) -> Channel { +pub async fn create(app: &App, created_at: &RequestedAt) -> Conversation { let name = propose(); - app.channels() + app.conversations() .create(&name, created_at) .await - .expect("should always succeed if the channel is actually new") + .expect("should always succeed if the conversation is actually new") } pub fn propose() -> Name { @@ -33,6 +33,6 @@ faker_impl_from_templates! { NameTemplate; "{} {}", CityName, FullName; } -pub fn fictitious() -> channel::Id { - channel::Id::generate() +pub fn fictitious() -> conversation::Id { + conversation::Id::generate() } diff --git a/src/test/fixtures/event/mod.rs b/src/test/fixtures/event/mod.rs index 691cdeb..08b17e7 100644 --- a/src/test/fixtures/event/mod.rs +++ b/src/test/fixtures/event/mod.rs @@ -2,9 +2,9 @@ use crate::event::Event; pub mod stream; -pub fn channel(event: Event) -> Option<crate::channel::Event> { +pub fn conversation(event: Event) -> Option<crate::conversation::Event> { match event { - Event::Channel(channel) => Some(channel), + Event::Conversation(conversation) => Some(conversation), _ => None, } } @@ -23,8 +23,8 @@ pub fn user(event: Event) -> Option<crate::user::Event> { } } -pub mod channel { - use crate::channel::{Event, event}; +pub mod conversation { + use crate::conversation::{Event, event}; pub fn created(event: Event) -> Option<event::Created> { match event { diff --git a/src/test/fixtures/event/stream.rs b/src/test/fixtures/event/stream.rs index 6c2a1bf..5b3621d 100644 --- a/src/test/fixtures/event/stream.rs +++ b/src/test/fixtures/event/stream.rs @@ -2,8 +2,8 @@ use std::future::{self, Ready}; use crate::{event::Event, test::fixtures::event}; -pub fn channel(event: Event) -> Ready<Option<crate::channel::Event>> { - future::ready(event::channel(event)) +pub fn conversation(event: Event) -> Ready<Option<crate::conversation::Event>> { + future::ready(event::conversation(event)) } pub fn message(event: Event) -> Ready<Option<crate::message::Event>> { @@ -14,20 +14,20 @@ pub fn user(event: Event) -> Ready<Option<crate::user::Event>> { future::ready(event::user(event)) } -pub mod channel { +pub mod conversation { use std::future::{self, Ready}; use crate::{ - channel::{Event, event}, - test::fixtures::event::channel, + conversation::{Event, event}, + test::fixtures::event::conversation, }; pub fn created(event: Event) -> Ready<Option<event::Created>> { - future::ready(channel::created(event)) + future::ready(conversation::created(event)) } pub fn deleted(event: Event) -> Ready<Option<event::Deleted>> { - future::ready(channel::deleted(event)) + future::ready(conversation::deleted(event)) } } diff --git a/src/test/fixtures/message.rs b/src/test/fixtures/message.rs index 2254915..03f8072 100644 --- a/src/test/fixtures/message.rs +++ b/src/test/fixtures/message.rs @@ -2,19 +2,24 @@ use faker_rand::lorem::Paragraphs; use crate::{ app::App, - channel::Channel, clock::RequestedAt, + conversation::Conversation, message::{self, Body, Message}, user::User, }; -pub async fn send(app: &App, channel: &Channel, sender: &User, sent_at: &RequestedAt) -> Message { +pub async fn send( + app: &App, + conversation: &Conversation, + sender: &User, + sent_at: &RequestedAt, +) -> Message { let body = propose(); app.messages() - .send(&channel.id, sender, sent_at, &body) + .send(&conversation.id, sender, sent_at, &body) .await - .expect("should succeed if the channel exists") + .expect("should succeed if the conversation exists") } pub fn propose() -> Body { diff --git a/src/test/fixtures/mod.rs b/src/test/fixtures/mod.rs index 418bdb5..87d3fa1 100644 --- a/src/test/fixtures/mod.rs +++ b/src/test/fixtures/mod.rs @@ -3,7 +3,7 @@ use chrono::{TimeDelta, Utc}; use crate::{app::App, clock::RequestedAt, db}; pub mod boot; -pub mod channel; +pub mod conversation; pub mod cookie; pub mod event; pub mod future; |
