Skip to content

fix: default host when empty#63

Merged
marandaneto merged 2 commits intomainfrom
fix/default-empty-host
Apr 30, 2026
Merged

fix: default host when empty#63
marandaneto merged 2 commits intomainfrom
fix/default-empty-host

Conversation

@marandaneto
Copy link
Copy Markdown
Member

💡 Motivation and Context

PostHogConfig already defaults Host when omitted, but explicitly setting it to null or an empty value caused validation to fail. This keeps host configuration optional by falling back to the default PostHog host for blank values.

💚 How did you test it?

  • DOTNET_ROLL_FORWARD=Major dotnet test tests/PostHog.Unity.Tests/PostHog.Unity.Tests.csproj --no-restore

📝 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
  • Added the release label to the PR

@marandaneto marandaneto marked this pull request as ready for review April 30, 2026 12:15
@marandaneto marandaneto requested a review from a team as a code owner April 30, 2026 12:15
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 30, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
tests/PostHog.Unity.Tests/PostHogConfigTests.cs:67-84
**Prefer a parameterised theory + add whitespace case**

The team rule prefers `[Theory]` over repeating near-identical `[Fact]` tests. The two new facts share identical structure and could be a single theory. Additionally, `Validate()` uses `IsNullOrWhiteSpace`, so a whitespace-only host is also defaulted, but there is no test covering that case (while the analogous `WithWhitespaceApiKey_ThrowsArgumentException` test exists for `ApiKey`).

Reviews (1): Last reviewed commit: "fix: default host when empty" | Re-trigger Greptile

Comment thread tests/PostHog.Unity.Tests/PostHogConfigTests.cs Outdated
@marandaneto marandaneto merged commit 4580627 into main Apr 30, 2026
13 checks passed
@marandaneto marandaneto deleted the fix/default-empty-host branch April 30, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants