Repository navigation
fix: reapply automatic error hooks on repeated setup - #629
Merged
Merged
Conversation
|
[Medium risk] Resets error-tracking hooks when setup is called again. The PR appears safe to merge; native isolate-listener reconfiguration would benefit from a regression test. Reviews (1) · Last reviewed commit: "fix: reapply automatic error hooks on re..." |
Contributor
posthog-flutter Compliance ReportDate: 2026-09-30 15:41:31 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
September 30, 2026 14:18
There was a problem hiding this comment.
This review was skipped because it would exceed your organization's monthly flex usage limit. Raise the limit in billing settings or wait until the next billing period resets limits.
4 of 5 tasks
turnipdabeets
approved these changes
Sep 30, 2026
Base automatically changed from
fix/chained-error-handler-lifecycle
to
main
September 30, 2026 15:14
# Conflicts: # posthog_flutter/lib/src/error_tracking/posthog_error_tracking_autocapture_integration.dart
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
Repeated
Posthog().setup(config)stores the new config but leaves the first Dart error-tracking integration installed. Turning automatic hooks off does not stop captures. Turning another hook on does not install it. A replacement config also leaves the old silent-error policy active.The shared installation path now uninstalls the previous integration before applying the current flags. This restores disabled hooks, installs enabled hooks, and uses the current error-tracking config. The setup documentation clarifies that repeated setup reapplies Dart-side settings, including these hooks. Most native settings still require
close()before setup.The setup spec permits repeated setup to be a no-op and does not require live reconfiguration. This change deliberately reapplies Dart error hooks while preserving one active integration. Native repeated-setup behavior is unchanged. There are no public API signature changes.
💚 How did you test it?
[1, 0, 1]and passed 10 consecutive runs. Removing the setup teardown call makes it fail with[1, 1, 1].make checkFormatDart,make analyzeDart,make checkApiDart, andgit diff --check.pnpm exec changeset status --since=origin/mainschedules a patch forposthog_flutter. Corrected this PR's package name and removed the already-released changeset inherited from fix: preserve chained error handlers across restarts #624.426feee:autoreview --mode branch --base origin/main.Native example builds were not run locally. CI covers the example builds.
📝 Checklist
If releasing new changes
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Investigated and fixed with Pi using Git, Flutter/Dart, GitHub CLI, and isolated autoreview. The work stayed in the dedicated investigation worktree. The fix reuses the existing integration teardown rather than adding per-callback flag checks or a new configuration API. The investigation notes remain local and are not part of this PR.