Updated engage snippets to accomodate feedback#945
Conversation
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request enables continuation publishing in the Engage worker, implements an empty continuation guard to delete clusters when no data is present, and adds a helper function demonstrating dual content rating conversions. The review identified critical compilation errors due to a missing constant definition and an unimplemented method in ClusterRequestFactory. Additionally, it is recommended to use localized string resources instead of a hardcoded title for the recommendation cluster.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| val items = appDataRepository.getRecommendations() | ||
| val recommendationCluster = com.google.android.engage.common.datamodel.RecommendationCluster.Builder() | ||
| .setTitle("Recommended Content") // Required field |
There was a problem hiding this comment.
The title string "Recommended Content" is hardcoded. To support internationalization (i18n) and localization, it is recommended to retrieve this string from the application resources using context.getString().
| .setTitle("Recommended Content") // Required field | |
| .setTitle(context.getString(R.string.recommended_content)) // Required field |
1. Updated EngageWorker to ensure empty continuation cluster publish guard 2. Updated ClusterRequestFactory to ensure account profile and recommendation type are added 3. Updated ItemToEntityConverter to add code
kkuan2011
left a comment
There was a problem hiding this comment.
Thanks Shashvat for the PR! Would you mind getting a teammate to approve the PR first? Then Yacine/I can approve. Thank you!
| .setEntityId(movie.id) | ||
| .setName(movie.title) | ||
| // ... other fields | ||
| .addContentRating(ratingSystem) // Recommended API |
There was a problem hiding this comment.
to confirm, you want both addContentRating and addContentRatingLegacy to be called on the same builder?
Updated EngageWorker to ensure empty continuation cluster publish guard
Updated ClusterRequestFactory to ensure account profile and recommendation type are added
Updated ItemToEntityConverter to add code