Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…lush drain Add maxQueueSize to ConsentConfig with drop-oldest overflow behavior. Emit queue:drop events (with count and reason) when events are lost to either timeout expiry or queue overflow, giving the debug panel and application code visibility into data loss. Enhance flush() to drain the consent queue for any now-permitted events. This is critical for page unload: the client calls flush() on pagehide, and previously queued events that gained consent would have been lost. Closes #5 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d0eda3e to
ffa010f
Compare
Merged
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.
Summary
Closes #5 — three related consent queue gaps identified during adversarial review:
maxQueueSizeoption onConsentConfig. When exceeded, oldest events are dropped (drop-oldest strategy, consistent with ring buffer semantics).queue:dropevent emitted with{ count, reason: "timeout" | "overflow" }whenever events are lost. Feeds into debug panel and application monitoring.flush()now drains the consent queue for any now-permitted events, not just the event buffer. Critical for page unload — the client callsflush()onpagehide, and previously queued events that gained consent would have been silently lost.Files changed
packages/core/src/types.ts—maxQueueSizeonConsentConfig,queue:droponCollectorEventpackages/core/src/consent.ts—onDroplistener, overflow enforcement inenqueue(), drop notification in cleanup timerpackages/core/src/collector.ts— wirequeue:dropemission, enhanceflush()to drain consent queueTest plan
🤖 Generated with Claude Code