Skip to content

Commit

Permalink
Fixes "Failed to persist session" error on iOS (#3655)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell authored Oct 7, 2024
1 parent 2d52998 commit bc31f16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- Fixed "Failed to persist session" error on iOS ([#3655](https://github.com/getsentry/sentry-dotnet/pull/3655))

### Dependencies

- Bump CLI from v2.36.5 to v2.36.6 ([#3647](https://github.com/getsentry/sentry-dotnet/pull/3647))
Expand Down
3 changes: 1 addition & 2 deletions src/Sentry/GlobalSessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ private void PersistSession(SessionUpdate update, DateTimeOffset? pauseTimestamp
return;
}

using var writer = new Utf8JsonWriter(file);

try
{
using var writer = new Utf8JsonWriter(file);
persistedSessionUpdate.WriteTo(writer, _options.DiagnosticLogger);
writer.Flush();
}
Expand Down

0 comments on commit bc31f16

Please sign in to comment.