Skip to content

feat: added offline mode to aid in testing#444

Merged
pavkam merged 1 commit intomainfrom
add-browser-sdk-offline-mode-for-testing
Jul 16, 2025
Merged

feat: added offline mode to aid in testing#444
pavkam merged 1 commit intomainfrom
add-browser-sdk-offline-mode-for-testing

Conversation

@pavkam
Copy link
Contributor

@pavkam pavkam commented Jul 16, 2025

This PR adds an optional offline mode to the browser SDK to aid with testing where contacting the servers is not needed.

@pavkam pavkam self-assigned this Jul 16, 2025
@pavkam pavkam requested review from Swiftwork, Copilot and roncohen July 16, 2025 10:41
Copy link
Contributor

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

This PR adds an optional offline mode to the browser SDK to enable testing scenarios where server communication is not required. The offline mode prevents all HTTP requests while maintaining the same API surface.

  • Added offline configuration option to client initialization
  • Modified core methods to skip HTTP calls when offline mode is enabled
  • Added comprehensive test coverage for offline functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/browser-sdk/src/client.ts Added offline configuration option and early returns in HTTP-dependent methods
packages/browser-sdk/src/feature/features.ts Added offline support to features client to prevent feature fetching
packages/browser-sdk/test/client.test.ts Added test coverage for offline mode functionality
Comments suppressed due to low confidence (1)

@pavkam pavkam enabled auto-merge July 16, 2025 10:56
Copy link
Contributor

@Swiftwork Swiftwork left a comment

Choose a reason for hiding this comment

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

Looks harmless but does this not need a package version bump? And has this been discussed?

Copy link
Contributor

@roncohen roncohen left a comment

Choose a reason for hiding this comment

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

Might be useful with some docs too.

@pavkam pavkam added this pull request to the merge queue Jul 16, 2025
Merged via the queue into main with commit be46e7c Jul 16, 2025
6 checks passed
@pavkam pavkam deleted the add-browser-sdk-offline-mode-for-testing branch July 16, 2025 11:53
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