Skip to content

fix: return booleans from immediate batch flushes#132

Merged
marandaneto merged 1 commit intomainfrom
fix/consistent-batch-flush-return
Apr 28, 2026
Merged

fix: return booleans from immediate batch flushes#132
marandaneto merged 1 commit intomainfrom
fix/consistent-batch-flush-return

Conversation

@marandaneto
Copy link
Copy Markdown
Member

💡 Motivation and Context

Fixes #57.

When batch_size is 1, queued calls flush immediately. LibCurl::flushBatch() returned the raw batch endpoint response body instead of a boolean, so PostHog::alias() could return a JSON string for immediate flushes but true when the event was only queued. The socket consumer also had related non-boolean/failure return paths during immediate flushes.

💚 How did you test it?

  • ./vendor/bin/phpunit --no-coverage --colors=never

📝 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

  • Added the release label to the PR
  • Added exactly one version bump label: bump-patch, bump-minor, or bump-major

@marandaneto marandaneto merged commit c54d689 into main Apr 28, 2026
16 checks passed
@marandaneto marandaneto deleted the fix/consistent-batch-flush-return branch April 28, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostHog::alias() returns a different type depending on batch_size

2 participants