Skip to content

Conversation

Copy link

Copilot AI commented Feb 12, 2026

Addressed review feedback to properly separate initialization state (isReady) from event processing state (running), matching Kotlin SDK architecture.

Core Changes

  • Added running state to Storage: New boolean property controls event processing independently from initialization. Defaults to false, set to true after init() completes.

  • Updated pause/resume logic: pauseEventProcessing() and resumeEventProcessing() now manipulate running instead of isReady, preventing conflicts with initialization lifecycle.

  • Fixed timeout race condition: Multiple waiting plugins no longer overwrite resumeTimeoutId. Only sets timeout once when not already present.

  • Event queueing respects running state: QueueFlushingPlugin.flush() checks running before processing. Events tracked while running=false are buffered to pendingEvents.

Code Quality

  • Converted single-line comments to JSDoc block format
  • Removed debug console.log statements
  • Removed special-case check preventing waiting plugins from being queued pre-initialization
  • Added explanatory comment for fire-and-forget void operator (Sovran updates state synchronously in-memory, persists async)

Test Updates

  • Updated all tests to use client.running API instead of manually setting isReady.value
  • Added running support to MockSegmentStore
  • All 9 waiting plugin tests passing

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Sunita Prajapati and others added 3 commits November 26, 2025 15:56
add waiting plugin interface.
any plugin implement this interface will pause event processing when it's added to analytics
any plugin implement this interface can pause and resume event processing as needed
Copilot AI and others added 4 commits February 12, 2026 02:32
Co-authored-by: abueide <19354425+abueide@users.noreply.github.com>
Co-authored-by: abueide <19354425+abueide@users.noreply.github.com>
Co-authored-by: abueide <19354425+abueide@users.noreply.github.com>
Co-authored-by: abueide <19354425+abueide@users.noreply.github.com>
Copilot AI changed the title [WIP] Add waiting plugin interface for event processing refactor: separate running state from isReady for event processing control Feb 12, 2026
Copilot AI requested a review from abueide February 12, 2026 02:43
- Fix test helpers to properly call this.resume() instead of bypassing plugin tracking
- Add update() method to ExampleWaitingPlugin1 to match Kotlin SDK behavior (3s delay)
- Remove console.log statements from test helpers
- Fix ExampleWaitingPlugin.tsx logic bug and add comprehensive documentation
- Remove commented-out code block from analytics.ts constructor
- Add extensive JSDoc to WaitingPlugin class with example usage and use cases
- Add JSDoc to pauseEventProcessing/resumeEventProcessing methods
- Document common use cases: IDFA permissions, SDK initialization, remote config

All 9 WaitingPlugin tests passing. Implementation now has better parity with
Kotlin SDK and includes documentation for developers.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants