fix(backend): allow users to disable apps that became private after install#5070
fix(backend): allow users to disable apps that became private after install#5070
Conversation
…nstall Users could not uninstall apps that were made private by the owner after installation, because the disable endpoint used get_available_app_by_id() which filters out private apps not owned by the requesting user. Now checks the user's enabled apps list first — if the app is installed, the user can always disable it regardless of visibility changes. Closes #4886 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
The pull request correctly fixes a bug where users could not disable an app that was made private after installation. The logic is sound. However, I've identified a significant performance issue in the new implementation that could affect users with many installed apps. My review includes a suggestion to address this performance bottleneck.
O(1) membership check instead of fetching the entire set with SMEMBERS and scanning in Python. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace get_enabled_apps() + list scan with O(1) SISMEMBER check to avoid transferring all enabled app IDs from Redis. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile review |
|
@greptile-apps review |
Greptile SummaryThis PR fixes a bug where users could not uninstall apps that had been made private by the owner after installation. The root cause was that The fix introduces a new Key changes:
The implementation correctly handles the primary bug fix: users can now uninstall apps they have installed, regardless of subsequent privacy changes. Confidence Score: 5/5
Last reviewed commit: 332aaf9 |
…nstall (BasedHardware#5070) * fix(backend): allow users to disable apps that became private after install Users could not uninstall apps that were made private by the owner after installation, because the disable endpoint used get_available_app_by_id() which filters out private apps not owned by the requesting user. Now checks the user's enabled apps list first — if the app is installed, the user can always disable it regardless of visibility changes. Closes BasedHardware#4886 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(backend): add is_app_enabled() helper using Redis SISMEMBER O(1) membership check instead of fetching the entire set with SMEMBERS and scanning in Python. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * perf(backend): use is_app_enabled() in disable endpoint Replace get_enabled_apps() + list scan with O(1) SISMEMBER check to avoid transferring all enabled app IDs from Redis. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
get_available_app_by_id()which filters out private apps not owned by the requesting userCloses #4886
Test plan
🤖 Generated with Claude Code