Repository navigation
fix: only move the current screen for wrapper events built as $screen - #1012
Merged
Merged
Conversation
Contributor
posthog-ios Compliance ReportDate: 2026-11-03T01:05:05.507541+00:00 ✅ All Tests Passed!233/233 tests passed Capture_V1 Tests✅ 106/106 tests passed View Details
Capture_Ai_V1 Tests✅ 110/110 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
approved these changes
Nov 3, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
5 of 8 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
Flutter builds a plain
capture(eventName: r'$screen')under another name, because native appliesscreen()rules to$screenbuilds, and restores the real name before sending.sendBuiltEventForWrapperonly looked at the name at send, so withbeforeSendcallbacks set, a plain capture moved the current screen and later events got its$screen_name. Without callbacks it doesn't.Now the current screen only moves when the event was built and sent as
$screen. The event itself is still sent as before.Raised in review: PostHog/posthog-flutter#682 (comment)
💚 How did you test it?
Added a regression test to
PostHogWrapperEventTest. It failed before the fix and passes now, with the wrapper suite (20 tests), usingswift test --no-parallel -Xswiftc -DTESTING --filter PostHogWrapperEventTeston macOS, not a simulator or device.swiftformat --lintis clean. I didn't run the full suite for this change.📝 Checklist
No changeset:
sendBuiltEventForWrapperis unreleased, wrapper-only API on this branch.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Written with Claude Code. A wrapper that renames a plain event to
$screenalso no longer moves the current screen; only posthog-flutter uses this API today. The screen check is separate from the distinct id fix in the sibling PR, and the two don't overlap.🤖 Generated with Claude Code