Skip to content

Fix session tracking issues#92

Merged
winsmith merged 1 commit intoTelemetryDeck:mainfrom
diogot:fix-issue-91
Aug 11, 2025
Merged

Fix session tracking issues#92
winsmith merged 1 commit intoTelemetryDeck:mainfrom
diogot:fix-issue-91

Conversation

@diogot
Copy link
Copy Markdown
Contributor

@diogot diogot commented Jul 30, 2025

If the start method is called when the app is already in the foreground handleOnForeground() is never called. So this will force call it on those cases.

  • Add lifecycle state check in register() method to handle cases where TelemetryDeck is initialized after the app process is already in the foreground
  • Call handleOnForeground() immediately if process is already STARTED or RESUMED
  • Fixes issue where session IDs were null and session signals were missing
  • Resolves issue Session tracking issues #91

…Provider

- Add lifecycle state check in register() method to handle cases where TelemetryDeck
  is initialized after the app process is already in the foreground
- Import androidx.lifecycle.Lifecycle for state comparison
- Call handleOnForeground() immediately if process is already STARTED or RESUMED
- Fixes issue where session IDs were null and session signals were missing
- Resolves GitHub issue TelemetryDeck#91
@paulomendes
Copy link
Copy Markdown

Nice!

@winsmith
Copy link
Copy Markdown
Contributor

Fantastic, thanks a lot for this PR!

@winsmith winsmith merged commit 7adf422 into TelemetryDeck:main Aug 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants