Skip to content

fix(home): deduplicate explore apps in BotsPage - #6917

Open
SeniorZhai wants to merge 1 commit into
masterfrom
fix/bots-page-duplicate-keys
Open

SeniorZhai wants to merge 1 commit into
masterfrom
fix/bots-page-duplicate-keys

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

@gaotic

gaotic Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

AI review done for cc3ac8e in 3m 48s · 1 comment

Quality: Needs a fix before merge. Verification covered the SQL and Kotlin list transformations in isolation.

Role Model Status
Reviewer Codex codex/gpt-6.2-sol · effort high ok

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

1 participant