Skip to content

Upgrade Engage SDK to 1.6.0 and refactor service availability calls to use the new conditional service availability syntax - #5764

Open
amulyagaur wants to merge 2 commits into
Automattic:mainfrom
amulyagaur:feature/engage-sdk-1.6.0-upgrade
Open

Upgrade Engage SDK to 1.6.0 and refactor service availability calls to use the new conditional service availability syntax#5764
amulyagaur wants to merge 2 commits into
Automattic:mainfrom
amulyagaur:feature/engage-sdk-1.6.0-upgrade

Conversation

@amulyagaur

Copy link
Copy Markdown

Description

Unlock "Always On" Content Publishing for selected content types with Engage SDK v1.6.0

Background & Changes

This PR upgrades the Google Play Engage SDK from 1.5.12 to 1.6.0 to adopt Conditional Service Availability.

Previously, client.isServiceAvailable performed a generic, binary check across all cluster types. With Engage SDK v1.6.0, apps can pass a ServiceAvailabilityRequest with specific intended cluster types (ClusterType.TYPE_CONTINUATION, ClusterType.TYPE_RECOMMENDATION, ClusterType.TYPE_FEATURED, and ClusterType.TYPE_ENGAGEMENT).

This allows lightweight, user-action-driven content like Continue Listening (TYPE_CONTINUATION) and account data (TYPE_ENGAGEMENT) to remain "Always On" and up-to-date, while keeping heavier recommendation feeds on optimized intermittent schedules.

Summary of Changes:

  • Dependency Update: Bumped engage-core to 1.6.0 in gradle/libs.versions.toml.
  • Worker Availability Checks: Refactored ClusterSyncWorker to build a ServiceAvailabilityRequest matching the specific cluster type (Recommendations, Continuation, Featured) before triggering cluster sync.
  • Account Sync: Updated EngageSdkAccountSync to pass ServiceAvailabilityRequest with ClusterType.TYPE_ENGAGEMENT before updating user account metadata.

More details here - https://developer.android.com/guide/playcore/engage/listen#for_engage_sdk_v160_and_higher_recommended


Testing Instructions

  1. Build and install the app on an Android device or emulator.
  2. Launch the app and confirm the initial startup and account sync complete without crashes.
  3. Navigate to the Discover tab to trigger FeaturedWorker and RecommendationsSyncWorker.
  4. Play any podcast episode for a few seconds and tap Pause to trigger ContinuationSyncWorker.
  5. Check logcat (adb logcat | grep -i Engage) to verify that isServiceAvailable() evaluates successfully for the intended cluster types and all sync operations complete cleanly.

Screenshots or Screencast

NA (Non-UI background integration)


Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

I have tested any UI changes...

NA

@amulyagaur
amulyagaur requested a review from a team as a code owner August 21, 2026 16:03
@amulyagaur
amulyagaur requested review from geekygecko and removed request for a team August 21, 2026 16:03
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

val availabilityMap = client.isServiceAvailable(request).await()
availabilityMap[clusterType] == true
} catch (e: Throwable) {
Timber.tag(TAG).d(e, "Failed to check service availability for '$type' cluster.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for making this change. I'm having a bit of trouble testing it. It's giving me the following error. Any ideas what I might be doing wrong?

Engage SDK service is not avaialable. Failing 'Recommendations' cluster sync.
Engage SDK service is not avaialable. Failing 'Continuation' cluster sync.
Engage SDK service is not avaialable. Failing 'Featured' cluster sync.

@geekygecko

Copy link
Copy Markdown
Member

Would you mind signing the open source Contributor License Agreement above?

@amulyagaur

Copy link
Copy Markdown
Author

Would you mind signing the open source Contributor License Agreement above?

Hey @geekygecko , I have already signed the agreement twice, but the system does not seems to take that into account. Is there any known issue for the same?

@geekygecko geekygecko added this to the 8.20 milestone Aug 25, 2026
@geekygecko geekygecko added [Type] Tech Debt Involving upgrades or refactoring to maintain or enhance the codebase. [Project] Engage SDK labels Aug 25, 2026
@geekygecko

Copy link
Copy Markdown
Member

Hey @geekygecko , I have already signed the agreement twice, but the system does not seems to take that into account. Is there any known issue for the same?

The commits are coming from another user, @amulyagaur-commits. Is it possible to sign the CLA with this user?

Thanks for making this change. I'm having a bit of trouble testing it. It's giving me the following error. Any ideas what I might be doing wrong?

Do you have any advice on how to test this? I can't see the clusters in the Play Engage Verify App.

@amulyagaur

Copy link
Copy Markdown
Author

Do you have any advice on how to test this? I can't see the clusters in the Play Engage Verify App.

If you want to see the clusters in verify app, Please make the following changes -

  1. Change engage environment to DEBUG in the file (modules/features/engage/src/main/AndroidManifest.xml)
  2. Change the package name in the file app/src/debug/google-services.json to au.com.shiftyjelly.pocketcasts (removing .debug prefix).

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

Labels

[Project] Engage SDK [Type] Tech Debt Involving upgrades or refactoring to maintain or enhance the codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants