Skip to content

refactor!: remove unused integration option from ISocketOptions - #442

Open
Pushkar-Shahi wants to merge 1 commit into
RocketChat:mobilefrom
Pushkar-Shahi:fix/remove-unused-integration-option
Open

Pushkar-Shahi wants to merge 1 commit into
RocketChat:mobilefrom
Pushkar-Shahi:fix/remove-unused-integration-option

Conversation

@Pushkar-Shahi

Copy link
Copy Markdown

Proposed changes

Removes the unused integration option from ISocketOptions and collapses ISocketConfig to Required<ISocketOptions>.

Context from #311:

  • close was already removed from ISocketOptions in feat: allow only one active Connection Attempt #421 (with the contract assertion in consumer/driver-contract.ts), leaving integration as the remaining option no code path reads.
  • Message bot attribution uses integrationId in lib/api/api.ts (prepareMessage), not ISocketOptions.integration.
  • Verified against the -mobile fork's consumer (RocketChat/Rocket.Chat.ReactNative at commit e90a19ffff954c4f86a337940de19cc6b29d0be8): none of the Rocketchat / RocketchatClient call sites (sdk.ts, connect.ts, logout.ts, sdkIntegration.ts) pass integration, and ISocketOptions is not referenced directly.

Changes:

  • Remove @param integration and integration?: string from ISocketOptions in interfaces/index.ts.
  • Simplify ISocketConfig to Required<ISocketOptions> and remove the stale integration note from its JSDoc.
  • Add Expect<Equal<'integration' extends keyof ISocketOptions ? true : false, false>> to consumer/driver-contract.ts (matching the existing close assertion).

Release note / Breaking change: ISocketOptions.integration has been removed. No runtime code path read it; callers setting bot attribution on messages use integrationId.

Issue(s)

Closes #311

How to test or reproduce

  • npm run lint (0 errors)
  • npm run typecheck (tsc -p tsconfig.json && tsc -p tsconfig.test.json && tsc -p tsconfig.consumer.json)
  • npm test (TZ=UTC jest, 34 suites / 455 tests passed)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

close was already removed in RocketChat#421, leaving integration as the only option on ISocketOptions that no code path reads. Message bot attribution uses integrationId (destructured in REST API prepareMessage), and Rocket.Chat.ReactNative passes neither option.

Collapse ISocketConfig to Required<ISocketOptions>, update its JSDoc, and add a consumer contract assertion matching close.

BREAKING CHANGE: Remove the unused integration field from ISocketOptions.

Fixes RocketChat#311

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the two ISocketOptions options no code path reads: close and integration

1 participant