Skip to content

Commit bc31f16

Browse files
Fixes "Failed to persist session" error on iOS (#3655)
1 parent 2d52998 commit bc31f16

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- Fixed "Failed to persist session" error on iOS ([#3655](https://github.com/getsentry/sentry-dotnet/pull/3655))
8+
59
### Dependencies
610

711
- Bump CLI from v2.36.5 to v2.36.6 ([#3647](https://github.com/getsentry/sentry-dotnet/pull/3647))

src/Sentry/GlobalSessionManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ private void PersistSession(SessionUpdate update, DateTimeOffset? pauseTimestamp
7676
return;
7777
}
7878

79-
using var writer = new Utf8JsonWriter(file);
80-
8179
try
8280
{
81+
using var writer = new Utf8JsonWriter(file);
8382
persistedSessionUpdate.WriteTo(writer, _options.DiagnosticLogger);
8483
writer.Flush();
8584
}

0 commit comments

Comments
 (0)