Refactor: Move REST wire types into shared crate (kill server/SDK/bot drift) #82
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Category: Refactor / maintainability — found in code review 2026-07-07. Highest-leverage cleanup.
Problem
Every REST request/response body is hand-duplicated between
server/src/**/models.rsandsdk/rust/src/rest/models.rs(the SDK file's own doc-comment admits "must stay in lockstep"). The message/channel/role/member shapes are duplicated a third time intools/bot-sdk/src/events.rs. Serde silently ignores unknown fields, so drift hides (e.g. bot-sdkMessageEventalready omitsdeleted/attachments/reactions/thread).By contrast,
shared::gatewayandshared::authtypes are shared correctly by both sides — that's the model to follow.Fix
sharedwith#[derive(Serialize, Deserialize)].server/src/**/models.rsre-export orFrom-convert fromshared.sdk/rust/src/rest/models.rsbodies withpub use shared::....sharedand have both the server broadcaster and bot-sdk consume them.SUBSCRIBE/UNSUBSCRIBE/HEARTBEAT_ACK) through the sharedOp/ClientCommandenum instead of raw string literals (sdk/rust/src/gateway.rs:197).