fix: report package-specific library metadata - #314
Merged
Conversation
Contributor
posthog-dotnet Compliance ReportDate: 2026-09-03 10:12:48 UTC ✅ All Tests Passed!17/17 tests passed Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
September 3, 2026 07:49
Contributor
Prompt To Fix All With AI### Issue 1
src/PostHog/Api/CapturedEvent.cs:29-30
**Replacement events lose integration metadata**
When an ASP.NET Core `BeforeSend` callback returns a newly constructed `CapturedEvent`, this public constructor stamps `posthog-dotnet` and the core version, and the replacement is uploaded without restoring the configured metadata. The event therefore loses its ASP.NET Core identity and disagrees with the integration-specific HTTP User-Agent.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix: report package-specific library met..." | Re-trigger Greptile |
ioannisj
approved these changes
Sep 3, 2026
|
|
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
The core and ASP.NET Core packages both reported
$libasposthog-dotnet. This made ASP.NET Core events indistinguishable from events sent directly through the core package. AI events also reported the core SDK name in$ai_liband did not include the AI package version.This change keeps
posthog-dotnetfor the core package and reportsposthog-aspnetcorewith the ASP.NET Core package version when ASP.NET Core registration is used. The ASP.NET Core identity is used in captured events, feature flag request properties, and the HTTP User-Agent header. AI events now include$ai_libasposthog-aiand$ai_lib_versionas the AI package version while the core$libremainsposthog-dotnet.💚 How did you test it?
dotnet test --no-restore.dotnet test tests/UnitTests.AspNetCore/UnitTests.AspNetCore.csproj --no-restoreafter adding coverage for feature flag requests and the User-Agent header.dotnet build --configuration Release --no-restore --nologo.bin/fmt --check.pnpm changeset status.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi coding agent implemented the change in a dedicated worktree. Pi autoreview checked the latest committed branch against
origin/mainand reported no actionable findings. The session was run locally and has no public link.The package names and versions are configured internally so public client configuration does not change. Each integration generates its version metadata from its project version.