Skip to content
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

Fix timing issues when Bugsnag started after the focus event #825

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Update bugsnag-cocoa to [v6.29.0](https://github.com/bugsnag/bugsnag-cocoa/releases/tag/v6.29.0) [#814](https://github.com/bugsnag/bugsnag-unity/pull/814)

### Bug Fixes

- Fix timing issues when Bugsnag is started after the focus event. [#821](https://github.com/bugsnag/bugsnag-unity/pull/821)

## 8.0.0 (2024-06-12)

### Enhancements
Expand Down
2 changes: 2 additions & 0 deletions src/BugsnagUnity/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ private void InitStopwatches()
{
_foregroundStopwatch = new Stopwatch();
_backgroundStopwatch = new Stopwatch();
// Required in case the focus event is not recieved (if Bugsnag is started after it is sent)
_foregroundStopwatch.Start();
}

private void InitUserObject()
Expand Down
2 changes: 1 addition & 1 deletion src/BugsnagUnity/Native/Fallback/NativeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void AddIsLaunching(AppWithState app)
}
else
{
isLaunching = app.DurationInForeground?.TotalMilliseconds < Configuration.LaunchDurationMillis;
isLaunching = app.Duration?.TotalMilliseconds < Configuration.LaunchDurationMillis;
}
app.IsLaunching = isLaunching;
}
Expand Down
2 changes: 1 addition & 1 deletion src/BugsnagUnity/Native/Windows/NativeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void AddIsLaunching(AppWithState app)
}
else
{
isLaunching = app.DurationInForeground?.TotalMilliseconds < Configuration.LaunchDurationMillis;
isLaunching = app.Duration?.TotalMilliseconds < Configuration.LaunchDurationMillis;
}
app.IsLaunching = isLaunching;
}
Expand Down