Skip to content

FCE-2044 validate credentials at client creation#271

Merged
czerwiukk merged 7 commits into
mainfrom
FCE-2044/sdk-clients-should-fail-fast
Jun 2, 2026
Merged

FCE-2044 validate credentials at client creation#271
czerwiukk merged 7 commits into
mainfrom
FCE-2044/sdk-clients-should-fail-fast

Conversation

@czerwiukk
Copy link
Copy Markdown
Member

Description

Adds credentials validation to the preferred way of creating the client.
There is also a separate checkCredentials method if someone needs to create the client synchronously.

Motivation and Context

The SDK client should fail fast when misconfigured.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@linear
Copy link
Copy Markdown

linear Bot commented May 22, 2026

FCE-2044

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds fail-fast configuration/credential validation paths for FishjamClient, introducing an async factory to verify credentials against the backend and a reusable config-validation helper, with accompanying test coverage.

Changes:

  • Added validateFishjamConfig and MissingManagementTokenException to validate required config fields at construction time.
  • Introduced FishjamClient.create() (async factory) and checkCredentials() to validate credentials via a backend call.
  • Added new Vitest coverage for sync config validation and mocked credential-check behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/js-server-sdk/tests/config-validation.test.ts Adds tests for constructor config validation and mocked backend credential checks via getAllRooms.
packages/js-server-sdk/src/utils.ts Introduces validateFishjamConfig to enforce presence of fishjamId and managementToken.
packages/js-server-sdk/src/exceptions/index.ts Adds MissingManagementTokenException for missing/empty management token config.
packages/js-server-sdk/src/client.ts Validates config in constructor; adds create() async factory and checkCredentials() method with updated JSDoc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/js-server-sdk/src/client.ts Outdated
Comment thread packages/js-server-sdk/src/client.ts Outdated
Comment thread packages/js-server-sdk/src/client.ts
@czerwiukk czerwiukk force-pushed the FCE-2044/sdk-clients-should-fail-fast branch from b7dbaa5 to 1b61627 Compare May 25, 2026 08:57
Comment thread packages/js-server-sdk/src/utils.ts Outdated
@czerwiukk czerwiukk merged commit 51ddb2a into main Jun 2, 2026
3 checks passed
@czerwiukk czerwiukk deleted the FCE-2044/sdk-clients-should-fail-fast branch June 2, 2026 17:21
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.

3 participants