Repository navigation
fix(home): deduplicate explore apps in BotsPage - #6917
SeniorZhai wants to merge 1 commit into
Conversation
|
AI review done for Quality: Needs a fix before merge. Verification covered the SQL and Kotlin list transformations in isolation.
|
There was a problem hiding this comment.
AI review · Codex · cc3ac8e
The deduplication passed SQLite checks against both exported Room schemas and a standalone Kotlin check of the BotsPage list transformations. git diff --check passed. The Android build, Room code generation, and on-device rendering remain unverified because the pinned Gradle distribution and Android SDK were unavailable locally.
|
|
||
| @Query( | ||
| "SELECT a.*, u.is_verified, u.membership FROM apps a LEFT JOIN users u ON a.app_id = u.app_id WHERE u.relationship = 'FRIEND' ORDER BY u.full_name ASC", | ||
| "SELECT a.*, u.is_verified, u.membership FROM apps a LEFT JOIN users u ON a.app_id = u.app_id WHERE u.relationship = 'FRIEND' GROUP BY a.app_id ORDER BY u.full_name ASC", |
There was a problem hiding this comment.
GROUP BY a.app_id lets SQLite choose which matching friend supplies the verification badge, membership badge, and sort name. In a check against the exported Room schema with two friend rows for one app, running ANALYZE made the new query drop the app’s verified badge and move it later in the More preview. The previous preview kept the first row ordered by full_name. Keep the ordered query and deduplicate in Kotlin, or explicitly select a single user row before returning each app.
No description provided.