chore(@rocket.chat/ddp-client): introduce experimental Meteor independent DDP client (re-add)

Merged
GG
6mo ago
+1688-102

Summary

Re-adds the experimental SDK-over-DDP transport originally landed in #40301, with two regression fixes found while validating the legacy (flag-off) path.

  • Re-applies the Use_RC_SDK admin setting and the @rocket.chat/ddp-client-backed transport from #40301. Default remains off โ€” the migration ships dormant.
  • Forwards the original DDP-encoded result frame from method.call / method.callAnon REST responses back into Meteor's _streamHandlers instead of synthesising an error: 'unknown' envelope. Without this, withAsyncTOTP no longer recognised totp-required and the 2FA modal never opened for any Meteor method protected by twoFactorRequired.
  • Restores the { ...Meteor.status() } spread in ServerProvider.getStatus on the legacy path. Meteor.status() reuses the same internal object (mutated in place), so dropping the spread made useSyncExternalStore see an unchanged snapshot and ConnectionStatusBar froze on connect/drop.

Test plan

  • With Use_RC_SDK off (default), trigger a Meteor method protected by twoFactorRequired (e.g. saveUserProfile for a user with TOTP enabled) and confirm the TOTP modal opens and the call resolves once a valid code is submitted.
  • With Use_RC_SDK off, drop the network and confirm ConnectionStatusBar flips to "waiting"/"connecting" and back to "connected" without a hard reload.
  • With Use_RC_SDK on (URL ?sdk_transport=on or admin setting), smoke test login, message send, presence, and force-logout.
    Task: ARCH-2127

Summary by CodeRabbit

  • New Features

    • Added experimental "Use Rocket.Chat SDK" admin setting (General โ†’ General Settings) to enable alternative DDP transport for real-time communications.
    • Transport selection can be controlled per-tab via URL parameter or browser storage for testing purposes.
  • Chores

    • Added SDK transport layer dependencies.