Repository navigation
test(replay): keep trigger-started recording when remote config reloads unchanged event triggers - #852
Draft
ioannisj wants to merge 1 commit into
Draft
test(replay): keep trigger-started recording when remote config reloads unchanged event triggers#852ioannisj wants to merge 1 commit into
ioannisj wants to merge 1 commit into
Conversation
…ds unchanged event triggers
Contributor
|
Contributor
|
[Low impact] This test-only change appears safe to merge. Reviews (1) · Last reviewed commit: "test(replay): keep trigger-started recor..." · Reviewed by Greptile |
This branch has not been deployed
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
Parity check for posthog-ios#919. On iOS, every remote config load clears the event-trigger activation and stops replay, even when the trigger list is unchanged. So with a cached config, a trigger that fires right after launch starts recording and the first live
/configresponse stops it.Android doesn't have this bug.
triggerActivatedSessionIdis only set when a trigger matches and nothing on theonRemoteConfigpath resets it.shouldWaitForEventTriggersonly checks whether the current session was activated, so a config reload can only stop recording through the flag, master switch or sampling gates. That matches posthog-js, which also never resets activation on config.Adds a regression test to keep it that way. Test only, no SDK change.
💚 How did you test it?
remote config with unchanged event triggers keeps a trigger started recording. It starts from the cached config only, fires a trigger, then delivers the first live config and a later reload with the same triggers (same order and reordered), and asserts replay stays active for the same session id.onRemoteConfigand the test fails on the first live config, so it does catch the regression../gradlew :posthog-android:testDebugUnitTestandmake checkFormatpass.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
DRI: @ioannisj
Autonomy: Human-driven (agent-assisted)