Skip to content

Fix unhandled object disposed exception #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 5, 2025

Conversation

haacked
Copy link
Collaborator

@haacked haacked commented Mar 5, 2025

HttpContext.Items can be disposed by the time we're trying to set the cache. This is because we might be making in a background thread. In that case, we don't want to fail the operation.

Also added some overloads to CapturePageView and CaptureScreen that send feature flag data.

haacked added 3 commits March 4, 2025 18:15
HttpContext.Items can be disposed by the time we're trying to set the cache. This is because we might be making in a background thread. In that case, we don't want to fail the operation.
Update VersionConstants.cs
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds error handling for HttpContext disposal and enhances feature flag support in the PostHog .NET client.

  • Added graceful handling of ObjectDisposedException in HttpContextFeatureFlagCache when accessing HttpContext.Items from background threads
  • Added new overloads to CapturePageView and CaptureScreenView methods to support sending feature flag data
  • Added comprehensive test coverage for HttpContext disposal scenarios in HttpContextFeatureFlagCacheTests
  • Bumped version from 1.0.1 to 1.0.2 and fixed duplicate Nullable property in Directory.Build.props

6 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

haacked and others added 2 commits March 4, 2025 18:36
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@haacked haacked merged commit 89511a3 into main Mar 5, 2025
4 checks passed
@haacked haacked deleted the haacked/fix-unhandled-object-disposed-exception branch March 5, 2025 02:42
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.

1 participant