DDP, Driver and Socket name three different things, and the fields don't match them
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api, backend-api-design
Research direction
Start with CONTEXT.md, then inspect Driver, RocketChatClient, and ISocket to compare the documented layers with the current ddp and socket fields. Trace the external sdk.current.ddp usage in Rocket.Chat.ReactNative and determine the compatibility or migration requirements. Done means the naming and layering decisions are settled with their impact on consumers documented.
Written by the indexing model from the issue text.
Description
What
CONTEXT.md draws a clear line between two of these:
- Driver — the realtime transport behind a Client, speaking one wire protocol to the server. Explicitly not a Socket.
- Socket — the raw websocket inside a Driver.
DDP is the third word in play. In CONTEXT.md it is only ever a qualifier on the wire vocabulary — DDP message, DDP response, DDP error, DDP subscription — never a name for an object. But in the code it is used as a field name for objects, and for two different ones.
Where the names don't line up
Driver.ddpholds aSocket. So the field named after the protocol holds the raw websocket.RocketChatClient.ddpholds aDriver. Same field name, one level up, different type.RocketChatClientimplements ISocket, so the Client also claims to be a Socket, which by CONTEXT.md it is not.- Until recently
RocketChatClientalso carried asocketfield that held aDriver— a third name for the same thing, under the one word CONTEXT.md reserves for the websocket. That field is being removed (see #336), which is what surfaced the wider problem.
The result is that client.ddp.ddp is the Socket, and no field name predicts its own type. Reading a call site does not tell you which layer you are on.
Why it matters
The layers behave very differently — a Driver reconnects, tracks DDP subscriptions and speaks method calls; a Socket opens, closes and carries frames. Code that reaches the wrong one compiles fine and misbehaves at runtime. Rocket.Chat.ReactNative already reaches across the boundary (sdk.current.ddp for driver-level health checks), so the naming is load-bearing outside this repo too.
What to decide
- Whether
DDPshould name an object at all, or stay a qualifier on wire vocabulary as CONTEXT.md has it. - What
Driver's field for itsSocketshould be called. - What a Client's field for its
Drivershould be called, givenddpis the name consumers already use. - Whether
RocketChatClientshould keepimplements ISocket. - Whether any rename can land without breaking Rocket.Chat.ReactNative, and what the migration looks like if not.
This is a naming and layering review, not a bug — worth settling before more code is written against the current names.
- Dominant language
- TypeScript
- Stars
- 146
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RocketChat/Rocket.Chat.js.SDK
-
refactor: delete the unused replaceLog and silence exports from lib/log.tsPossibly taken @ayushi-wq claimed this 81 days ago. Openbug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
RocketChat/Rocket.Chat.js.SDK#380 · 1 comment ·
-
refactor: delete the unassigned messages and joinedIds fields on DriverPossibly taken @arbazkhan971 claimed this 68 days ago. Openbug ready-for-agent
Difficulty 1/5 Under an hour Newbie friendliness 90/100
RocketChat/Rocket.Chat.js.SDK#379 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
RocketChat/Rocket.Chat.js.SDK#308 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RocketChat/Rocket.Chat.js.SDK#306 ·
-
bug
Difficulty 2/5 Half a day Newbie friendliness 78/100
RocketChat/Rocket.Chat.js.SDK#254 ·
All issues in RocketChat/Rocket.Chat.js.SDK
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
"code source" and "numerique.gouv" links: "new window" mention duplicated in the accessible nameOpenaccessibility
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
numerique-gouv/lasuite-landingpage#315 ·
Maintainers usually reply within 1 day
-
needs:triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
HyeokjaeChoi/vaultme#585 ·
Maintainers usually reply within 1 day
-
enhancement priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
beettlle/pi-smart-router#200 ·