Skip to content

fix: decouple app lifecycle from sessions autocapture #284

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

Merged
merged 3 commits into from
May 29, 2025

Conversation

polbins
Copy link
Contributor

@polbins polbins commented May 28, 2025

Summary

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

@polbins polbins changed the title Pintal/amp 97478/decouple app lifecycle from sessions fix: decouple app lifecycle from sessions autocapture May 28, 2025
@polbins polbins requested a review from Copilot May 29, 2025 16:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR decouples the app lifecycle management from the sessions autocapture logic in the Amplitude Kotlin SDK.

  • Refactors the AndroidLifecyclePlugin to use a locally scoped configuration by capturing the autocapture set in a dedicated variable.
  • Updates all autocapture checks to use the new autocapture variable for improved decoupling.
  • Introduces a new test to verify that eventJob is created even when APP_LIFECYCLES is not enabled.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
android/src/test/kotlin/com/amplitude/android/plugins/AndroidLifecyclePluginTest.kt Adds a new test confirming eventJob creation when APP_LIFECYCLES is disabled.
android/src/main/java/com/amplitude/android/plugins/AndroidLifecyclePlugin.kt Refactors autocapture checks to use a locally stored autocapture variable and removes the redundant global configuration field.

@polbins polbins marked this pull request as ready for review May 29, 2025 16:51
@polbins polbins requested a review from igor-amp May 29, 2025 16:51
Copy link
Contributor

@igor-amp igor-amp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@polbins polbins merged commit 1521eb7 into main May 29, 2025
4 checks passed
@polbins polbins deleted the pintal/AMP-97478/decouple-app-lifecycle-from-sessions branch May 29, 2025 17:50
github-actions bot pushed a commit that referenced this pull request Jun 3, 2025
…...v1.21.2-beta.1) (2025-06-03)

### Bug Fixes

* decouple app lifecycle from sessions autocapture ([#284](#284)) ([1521eb7](1521eb7))
Copy link

github-actions bot commented Jun 3, 2025

🎉 This PR is included in version 1.21.2-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants