refactor: separate running state from isReady for event processing control#1123
Closed
Copilot wants to merge 8 commits intowaiting-pluginfrom
Closed
refactor: separate running state from isReady for event processing control#1123Copilot wants to merge 8 commits intowaiting-pluginfrom
Copilot wants to merge 8 commits intowaiting-pluginfrom
Conversation
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
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
- 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>
8bb3074 to
82e2dc1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressed review feedback to properly separate initialization state (
isReady) from event processing state (running), matching Kotlin SDK architecture.Core Changes
Added
runningstate to Storage: New boolean property controls event processing independently from initialization. Defaults tofalse, set totrueafterinit()completes.Updated pause/resume logic:
pauseEventProcessing()andresumeEventProcessing()now manipulaterunninginstead ofisReady, 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()checksrunningbefore processing. Events tracked whilerunning=falseare buffered topendingEvents.Code Quality
console.logstatementsvoidoperator (Sovran updates state synchronously in-memory, persists async)Test Updates
client.runningAPI instead of manually settingisReady.valuerunningsupport toMockSegmentStore💡 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.