Skip to content

Conversation

@Karlie-777
Copy link
Contributor

No description provided.

@Karlie-777 Karlie-777 requested a review from a team as a code owner September 22, 2025 17:07
Copilot AI review requested due to automatic review settings September 22, 2025 17:07
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 support for custom storage providers in the Offline Channel, allowing developers to provide their own storage implementations for web worker environments. This enables more flexible storage solutions beyond the built-in LocalStorage, SessionStorage, and IndexedDB providers.

Key changes:

  • Added customProvider and customUnloadProvider configuration options to allow custom storage implementations
  • Enhanced provider initialization logic to prioritize custom providers over default ones
  • Added comprehensive test coverage for custom provider scenarios

Reviewed Changes

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

File Description
channels/offline-channel-js/src/OfflineBatchHandler.ts Added custom provider initialization logic and fallback handling for unload scenarios
channels/offline-channel-js/src/Interfaces/IOfflineProvider.ts Added interface definitions for customProvider and customUnloadProvider configuration options
channels/offline-channel-js/Tests/Unit/src/offlinechannel.tests.ts Added import and registration for new custom provider tests
channels/offline-channel-js/Tests/Unit/src/customprovider.tests.ts Added comprehensive test suite covering custom provider initialization, fallback scenarios, and storage operations
Comments suppressed due to low confidence (1)

channels/offline-channel-js/Tests/Unit/src/customprovider.tests.ts:1

  • The MockNoopProvider is missing the addEvent method implementation in the dynamicProto constructor. This method should be included to match the interface requirements.
import { AITestClass, Assert } from "@microsoft/ai-test-framework";

return provider;
}
} catch (e) {
// eslint-disable-next-line no-empty
Copy link
Member

Choose a reason for hiding this comment

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

if we dont pass anything here then what is returned in _unloadProvider when an exception is thrown here? Will this be a type mismatch or will it pass an empty string?

@Karlie-777 Karlie-777 merged commit a17c60d into main Sep 22, 2025
9 of 12 checks passed
@Karlie-777 Karlie-777 deleted the karlie/customstorage branch September 22, 2025 20:58
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.

4 participants