-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WEB-3249] chore: delete the user recent visits #6496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis pull request introduces a consistent enhancement across multiple view files in the Plane application. The changes focus on importing the Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apiserver/plane/app/views/cycle/base.py (1)
547-553: Add error handling for the delete operation.While the deletion of user recent visits is correctly implemented, it's recommended to add error handling to gracefully handle any potential database errors.
Apply this diff to add error handling:
# Delete the cycle from recent visits -UserRecentVisit.objects.filter( - project_id=project_id, - workspace__slug=slug, - entity_identifier=pk, - entity_name="cycle", -).delete() +try: + UserRecentVisit.objects.filter( + project_id=project_id, + workspace__slug=slug, + entity_identifier=pk, + entity_name="cycle", + ).delete() +except Exception as e: + # Log the error but don't block the cycle deletion + logger.error(f"Error deleting user recent visits for cycle {pk}: {str(e)}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apiserver/plane/app/views/cycle/base.py(2 hunks)apiserver/plane/app/views/issue/base.py(2 hunks)apiserver/plane/app/views/module/base.py(2 hunks)apiserver/plane/app/views/page/base.py(2 hunks)apiserver/plane/app/views/view/base.py(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (python)
🔇 Additional comments (9)
apiserver/plane/app/views/view/base.py (2)
27-27: LGTM!Import of UserRecentVisit model is correctly placed with other model imports.
499-505: LGTM!The deletion of user recent visits is correctly implemented:
- Proper filtering using project_id, workspace slug, entity identifier and entity name
- Placed after deleting the view and user favorites
- Consistent with the cleanup process
apiserver/plane/app/views/page/base.py (2)
36-36: LGTM!Import of UserRecentVisit model is correctly placed with other model imports.
391-397: LGTM!The deletion of user recent visits is correctly implemented:
- Proper filtering using project_id, workspace slug, entity identifier and entity name
- Placed after deleting the page and user favorites
- Consistent with the cleanup process
apiserver/plane/app/views/module/base.py (2)
57-57: LGTM!Import of UserRecentVisit model is correctly placed with other model imports.
812-818: LGTM!The deletion of user recent visits is correctly implemented:
- Proper filtering using project_id, workspace slug, entity identifier and entity name
- Placed after deleting the module, module issues and user favorites
- Consistent with the cleanup process
apiserver/plane/app/views/issue/base.py (2)
47-47: LGTM!Import of UserRecentVisit model is correctly placed with other model imports.
675-681: LGTM!The deletion of user recent visits is correctly implemented:
- Proper filtering using project_id, workspace slug, entity identifier and entity name
- Placed after deleting the issue and before triggering the issue activity
- Consistent with the cleanup process
apiserver/plane/app/views/cycle/base.py (1)
50-50: LGTM!The import of
UserRecentVisitmodel is correctly placed with other model imports.
Description
delete user's recent visits when the entity is deleted.
Type of Change
References
Issue Link: WEB-3249
Summary by CodeRabbit
New Features
Improvements