What happens
RocketChatClient is the entry point every consumer builds. Its constructor in lib/clients/Rocketchat.ts is:
constructor ({ logger = Logger, ...config }: any) {
super({ ...config, logger })
this.ddp = new Driver({ ...config, logger })
}
The options bag is any, and it spreads into both Api and Driver. #340 gave Api's constructor a named IApiOptions, but the any above erases it before it can reject anything: a misspelled or unsupported key typechecks at the only call site anyone actually uses, and the mistake shows up as missing behaviour at runtime.
This is the hazard CLAUDE.md names — config spreads into the REST base, Driver and Socket, and only Socket re-picks the keys it knows, so an unrecognized option silently reaches the driver.
What to do
Give the constructor a named options type covering the keys it and its two collaborators actually read, and use it in place of any.
Unlike #340, this one is expected to surface real call-site breakage — in the SDK and in the consuming app, which constructs RocketChatClient directly. That is the point of the change, and the reason it wants its own PR.
Follow-up to #340.
What happens
RocketChatClientis the entry point every consumer builds. Its constructor inlib/clients/Rocketchat.tsis:The options bag is
any, and it spreads into bothApiandDriver. #340 gaveApi's constructor a namedIApiOptions, but theanyabove erases it before it can reject anything: a misspelled or unsupported key typechecks at the only call site anyone actually uses, and the mistake shows up as missing behaviour at runtime.This is the hazard CLAUDE.md names — config spreads into the REST base,
DriverandSocket, and onlySocketre-picks the keys it knows, so an unrecognized option silently reaches the driver.What to do
Give the constructor a named options type covering the keys it and its two collaborators actually read, and use it in place of
any.Unlike #340, this one is expected to surface real call-site breakage — in the SDK and in the consuming app, which constructs
RocketChatClientdirectly. That is the point of the change, and the reason it wants its own PR.Follow-up to #340.