Custom message routing

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
openapi, typescript

Research direction

The issue names no files, tests, or entry points. Start by reviewing the repository's TypeScript typings and OpenAPI v3 generator, then clarify how custom routes and their permission, immutability, and deletion rules fit the API. Done means the route model and lifecycle behavior are specified and implemented with validation and coverage.

Written by the indexing model from the issue text.

Description

enhancement
What do you want to see?

This could be useful for cross-posting and IoT-related use cases. Custom route management should be permissions-gated to prevent spamming by randomly creating message routes.

The semantics should be as follows: server-wide permissions allow you to create, alter and drop a message route targeting any channel, while per-guild permission only allows you to do so while requiring you to have either:

  • Posting, storage, view all within that guild
  • Posting channel is null (meaning that route is read-only) and view channel is within that guild, no constraints on storage channel

Routing rule

A routing rule shall consist of eight elements:

  • Timestamp of the registration (stored as snowflake)
  • Source channel
  • Storage channel
  • Sink channel
  • Source users (user, group or role ID)
  • Target users (user, group or role ID)
  • Valid since timestamp
  • Valid until timestamp

Invariants

  • Valid since cannot be earlier than time of registration
  • Valid until cannot be earlier than valid since
  • Source user set has to have message posting permission in the source channel at the time of use
  • Event type validity checks are done based on the storage channel
  • Target user set has to have read messages permission in the source channel at the time of use
  • Each routing rule is considered immutable once created, except for valid until timestamp, which can be set to any future time while the routing rule is still in effect

A routing rule can only be deleted in either of the following cases:

  • none of the source channels are present
  • none of the storage channels are present
  • none of the sink channels are present
  • the routing rule is not in effect AND no messages are affected by deletion of the routing rule
Dominant language
TypeScript
Stars
42
Forks
34
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stoatchat/javascript-client-api

All issues in stoatchat/javascript-client-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.