diff --git a/cchat.go b/cchat.go index 34f7f2d..cd7de73 100644 --- a/cchat.go +++ b/cchat.go @@ -6,6 +6,16 @@ // // Backend // +// Almost anything in the backend comes with an ID. For example, a Server must +// have an ID, or a Session must have a user ID. The backend is required to +// guarantee that IDs are somehow unique. This should already be the case for +// most chat services; for example, Discord provides IDs for guilds, channels, +// members, and more. The only time that the backend should not guarantee ID +// uniqueness is across Sessions, because it doesn't make sense to do so. In +// this case, the frontend should guarantee uniqueness instead, either by +// discarding duplicated items, overriding them, or anything reasonable and +// explicit. +// // Methods implemented by the backend that have frontend containers as arguments // can do IO. Frontends must NOT rely on individual backend states and should // always assume that they will block. diff --git a/repository/main.go b/repository/main.go index bc721fa..e4726e3 100644 --- a/repository/main.go +++ b/repository/main.go @@ -339,6 +339,17 @@ var Main = Packages{ Backend + Almost anything in the backend comes with an ID. For example, a + Server must have an ID, or a Session must have a user ID. The + backend is required to guarantee that IDs are somehow unique. This + should already be the case for most chat services; for example, + Discord provides IDs for guilds, channels, members, and more. The + only time that the backend should not guarantee ID uniqueness is + across Sessions, because it doesn't make sense to do so. In this + case, the frontend should guarantee uniqueness instead, either by + discarding duplicated items, overriding them, or anything + reasonable and explicit. + Methods implemented by the backend that have frontend containers as arguments can do IO. Frontends must NOT rely on individual backend states and should always assume that they will block.