Repository navigation
fix: only attach $sdk_debug_pending_queue_size once the queue reaches flushAt - #736
Merged
Merged
Conversation
Contributor
posthog-flutter Compliance ReportDate: 2026-11-20 08:51:38 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
marandaneto
marked this pull request as ready for review
November 20, 2026 08:56
PR overviewNo security issues were found in this pull request. Reviews
|
ioannisj
approved these changes
Nov 20, 2026
ioannisj
left a comment
Contributor
There was a problem hiding this comment.
🤖 An AI agent wrote this on behalf of @ioannisj.
No findings from me. I looked at the queue-size gate against PostHog/sdk-specs#238 and at the 413 path, which only shrinks _maxBatchSize, so flushAt stays the right threshold.
turnipdabeets
added a commit
that referenced
this pull request
Nov 20, 2026
Conflicts: #736's backedUpQueueLength reads the analytics lane's flushAt, since 6.0 replaced the single _flushAt with per-lane capture v1 queues; the HTTP client keeps its connection timeout. #736's test asserted that SDK debug values win over registered and caller properties, which 6.0 reverses (see "Check property precedence" in MIGRATION.md), so the ported test checks the flushAt threshold and keeps 6.0's precedence.
12 of 18 tasks
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.
💡 Motivation and Context
On Windows and Linux, the Dart core adds
$sdk_debug_pending_queue_sizeto every event, even when the queue holds fewer events thanflushAt. That is just normal batching, so the value adds bytes to every event without helping anyone find a delivery problem. iOS, macOS, Android and web events come from the native SDKs and posthog-js, which make the same change in their own PRs.Now the key is only attached once the queue holds at least
flushAtevents. The key stays SDK-owned. While the queue is healthy, a registered or caller-supplied value with the same name is left out of the event. When the queue is backed up, the SDK value replaces it, as before.This touches the same
_sessionDebugPropertiesblock as #733, which removes the session keys. Whichever lands second needs a small merge.Spec: PostHog/sdk-specs#238.
💚 How did you test it?
posthog_core_test.dartcase: no key belowflushAt, including registered and caller values, and the depth atflushAt. It failed before the change.flutter testpasses (1327 tests).dart formatandflutter analyzeare clean.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)