Repository navigation
chore: merge main into v1 (DO NOT SQUASH, lands by fast-forward) - #1270
Conversation
capture_exception() falls back to sys.exc_info() when no exception is passed, but only marked a passed exception as captured. A later capture of the same exception (a new_context exit, a framework integration, the excepthook, or a second call) then sent a duplicate $exception event. Mark the resolved exc_info, and skip a sys.exc_info() exception that is already marked. Client and AsyncClient both had the bug.
get_lines_from_file passed each line through strip_string, which wraps a truncated line in an AnnotatedValue. Nothing unwrapped it, so clean() turned it into None and lines over 1024 bytes reached the event as null in context_line, pre_context and post_context. Keep only the truncated string.
Brings in #1267, #1265 and the 7.91.3 and 7.91.4 releases. Conflicts in posthog/client.py and posthog/async_client.py keep v1's side: main's side is #1242's exception helpers, which v1 does not have. The next commit ports #1267's behavior into v1's capture_exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eption Ports #1267 to v1's inline capture_exception, which has no _exception_info helper. Client and AsyncClient both skip it, as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR overviewNo security issues were found in this pull request. Reviews
|
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
mainmoved after the last sync (#1262): #1267, #1265 and the 7.91.3 and 7.91.4 releases. The 8.0 release PR (#1016) conflicts withmainuntilv1carries them.Warning
Do not squash or merge this PR with the button. After approval it lands by fast-forwarding
v1to this exact head, which keeps the merge commit. Squashing drops it, and #1016 keeps conflicting.Changes:
ea491a79mergesmain(36027e3c).posthog/client.pyandposthog/async_client.pykeepv1's side.main's side is refactor: reduce SDK complexity and improve CRAP analysis #1242's exception helpers, whichv1does not have (left out in chore: merge main into v1 (DO NOT SQUASH, lands by fast-forward) #1262 too).e2b12f80ports fix: mark an exception taken from sys.exc_info() as captured #1267 intov1's inlinecapture_exceptioninClientandAsyncClient: an exception taken fromsys.exc_info()is marked as captured, and a later capture of it is skipped.💚 How did you test it?
mainchanged since chore: merge main into v1 (DO NOT SQUASH, lands by fast-forward) #1262 equalsmain's change on this head, exceptclient.pyandasync_client.py. There the change is exactly fix: mark an exception taken from sys.exc_info() as captured #1267's two behavior changes.e2b12f80reverted, its twosys.exc_info()cases fail with a duplicate$exception.test_metrics_autocapture.pyfail locally on pristinev1too (macOS fork).mainhas 0 conflicts, and the result equals this head. It also merges cleanly with fix: AI options on streaming connect errors; benchmark baseline route; review follow-ups #1264.📝 Checklist
If releasing new changes
sampo addto generate a changeset fileNo changeset:
main's changes shipped in 7.91.3 and 7.91.4, and 8.0's changesets are onv1.🤖 Agent context
Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code