Skip to content

fix: standardize event buffer defaults#262

Merged
dustinbyrne merged 1 commit into
mainfrom
chore/standardize-event-buffer-defaults
Jul 16, 2026
Merged

fix: standardize event buffer defaults#262
dustinbyrne merged 1 commit into
mainfrom
chore/standardize-event-buffer-defaults

Conversation

@dustinbyrne

@dustinbyrne dustinbyrne commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

The .NET SDK currently buffers 1,000 events, flushes after 20 events or 30 seconds, and caps batch requests at 100 events. Increase the queue to 10,000 events and standardize the flush threshold, maximum batch size, and flush interval at 100 events, 100 events, and 5 seconds respectively. These defaults align with the Python, Ruby, and Rails server-side SDKs, as summarized in the server-side SDK event buffer defaults comparison.

Related changes: Node.js SDK, Java server SDK, and PHP SDK.

💚 How did you test it?

  • dotnet restore --locked-mode
  • bin/fmt --check
  • dotnet build --configuration Release --no-restore --nologo
  • dotnet test tests/UnitTests/UnitTests.csproj --configuration Release --no-build --nologo --framework net8.0 (945 passed, 2 skipped)
  • dotnet test tests/UnitTests.AspNetCore/UnitTests.AspNetCore.csproj --configuration Release --no-build --nologo --framework net8.0 (49 passed)
  • dotnet test tests/PostHog.AI.Tests/PostHog.AI.Tests.csproj --configuration Release --no-build --nologo --framework net8.0 (19 passed)

The legacy netcoreapp3.1 test target could not run locally because this arm64 machine does not have the required x64 .NET host; CI will cover that target.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with the Pi coding agent as part of a human-directed server-side SDK standardization. Updated PostHogOptions, its XML documentation, configuration/default assertions, and a patch changeset for the core PostHog package. The existing 100-event maximum batch size already matched the target and remains unchanged.

@dustinbyrne
dustinbyrne requested a review from a team as a code owner July 16, 2026 14:16
@dustinbyrne dustinbyrne self-assigned this Jul 16, 2026
@dustinbyrne dustinbyrne changed the title chore: standardize event buffer defaults fix: standardize event buffer defaults Jul 16, 2026
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "chore: standardize event buffer defaults" | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

posthog-dotnet Compliance Report

Date: 2026-07-16 14:21:11 UTC
Duration: 4420ms

✅ All Tests Passed!

17/17 tests passed


Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 246ms
Request Payload.Flags Request Uses V2 Query Param 130ms
Request Payload.Flags Request Hits Flags Path Not Decide 111ms
Request Payload.Flags Request Omits Authorization Header 110ms
Request Payload.Token In Flags Body Matches Init 111ms
Request Payload.Groups Round Trip 113ms
Request Payload.Groups Default To Empty Object 110ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 109ms
Request Payload.Disable Geoip Omitted Defaults To False 110ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 111ms
Request Lifecycle.No Flags Request On Init Alone 4ms
Request Lifecycle.No Flags Request On Normal Capture 115ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 214ms
Request Lifecycle.Mock Response Value Is Returned To Caller 115ms
Retry Behavior.Retries Flags On 502 1117ms
Retry Behavior.Retries Flags On 504 1114ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 213ms

@dustinbyrne
dustinbyrne merged commit 90e0c94 into main Jul 16, 2026
22 of 23 checks passed
@dustinbyrne
dustinbyrne deleted the chore/standardize-event-buffer-defaults branch July 16, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants