diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c64b9c765..f58853ab63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/Sentry/GlobalSessionManager.cs b/src/Sentry/GlobalSessionManager.cs index 4284bd208e..35125817aa 100644 --- a/src/Sentry/GlobalSessionManager.cs +++ b/src/Sentry/GlobalSessionManager.cs @@ -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(); }