Disposing the Hub with AutoSessionTracking gives an error
See original GitHub issueAs observed on Unity, when you dispose of a hub and usingAutoSessionTracking, an error will be thrown once the SDK disposes of the SDK hub. You can reproduce the error with the following snippet:
void StartSentry()
{
SentrySdk.Init(o =>
{
o.Dsn = "https://eb18e953812b41c3aeb042e666fd3b5c@o447951.ingest.sentry.io/5428537";
o.AutoSessionTracking = true;
o.CacheDirectoryPath = "C:/Users/.../AppData/LocalLow/Sentry/Sentry Defenses/Sentry";
o.Debug = true;
});
}
StartSentry();
StartSentry();
Console.ReadKey();
The following error was received:
Error: Failed to send cached envelope: C:/Users/lucas/AppData/LocalLow/Sentry/Sentry Defenses/Sentry\Sentry\132A73C90BBA506000857BC4BFC23E574F1551B5\__processing\1638992610_1647__6590935.envelope, retrying after a delay.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Sentry.Internal.Extensions.StreamExtensions.ReadAllBytesAsync(Stream stream, CancellationToken cancellationToken)+MoveNext() in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Internal\Extensions\StreamExtensions.cs:line 18
at Sentry.Internal.Extensions.StreamExtensions.ReadAllBytesAsync(Stream stream, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Sentry.Protocol.Envelopes.Envelope.DeserializeHeaderAsync(Stream stream, CancellationToken cancellationToken) in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Envelopes\Envelope.cs:line 188
at Sentry.Protocol.Envelopes.Envelope.DeserializeHeaderAsync(Stream stream, CancellationToken cancellationToken) in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Envelopes\Envelope.cs:line 188
at Sentry.Protocol.Envelopes.Envelope.DeserializeAsync(Stream stream, CancellationToken cancellationToken) in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Envelopes\Envelope.cs:line 212
at Sentry.Internal.Http.CachingTransport.InnerProcessCacheAsync(String envelopeFilePath, CancellationToken cancellationToken) in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Internal\Http\CachingTransport.cs:line 195
at Sentry.Internal.Http.CachingTransport.InnerProcessCacheAsync(String envelopeFilePath, CancellationToken cancellationToken) in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Internal\Http\CachingTransport.cs:line 207
at Sentry.Internal.Http.CachingTransport.ProcessCacheAsync(CancellationToken cancellationToken) in D:\Development\Online Projects\Sentry\sentry-dotnet\src\Sentry\Internal\Http\CachingTransport.cs:line 159 Debug: Background worker of CachingTransport has shutdown.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Basic Options for Browser JavaScript
By default, all errors are sent. autoSessionTracking. When set to true , the SDK will send session events to Sentry. This is supported...
Read more >Sessions | Sentry Developer Documentation
Sessions and error events are two distinct systems within Sentry. Session updates can be done without error events to be sent and likewise,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That would be breaking though, wouldn’t it?
so should we throw on the second init call?