-
Notifications
You must be signed in to change notification settings - Fork 14
fix: show tasks assigned to team members in team todo list #231
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
fix: show tasks assigned to team members in team todo list #231
Conversation
- Updated TaskRepository to include tasks assigned to team members in team's todo list - Modified _get_assigned_task_ids_for_team to aggregate both direct team and member assignments - Ensured team task queries now reflect all relevant tasks for the team
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughA new private class method was added to Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant TaskRepository
participant UserTeamDetailsRepository
Client->>TaskRepository: list(team_id)
TaskRepository->>TaskRepository: _get_assigned_task_ids_for_team(team_id)
TaskRepository->>TaskRepository: fetch tasks assigned directly to team
TaskRepository->>UserTeamDetailsRepository: get_users_by_team_id(team_id)
UserTeamDetailsRepository-->>TaskRepository: user_ids
TaskRepository->>TaskRepository: fetch tasks assigned to user_ids
TaskRepository-->>Client: combined tasks
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
todo/repositories/task_repository.py
(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Achintya-Chatterjee
PR: Real-Dev-Squad/todo-backend#227
File: todo/repositories/task_repository.py:0-0
Timestamp: 2025-07-23T19:26:43.747Z
Learning: In the todo-backend project, the get_tasks_for_user method in TaskRepository is intentionally designed to return only tasks assigned to the user (not tasks created by them), while the count method includes both tasks created by and assigned to the user. This behavioral difference is by design to serve different use cases.
Learnt from: Achintya-Chatterjee
PR: Real-Dev-Squad/todo-backend#52
File: todo/views/task.py:106-106
Timestamp: 2025-05-29T21:36:27.694Z
Learning: Issue #26 in the Real-Dev-Squad/todo-backend repository comprehensively tracks user authentication implementation including registration, login, JWT tokens, and making task APIs require authentication. This covers replacing hardcoded user ID placeholders like "system_patch_user" with actual user ID extraction from authenticated requests.
Learnt from: Achintya-Chatterjee
PR: Real-Dev-Squad/todo-backend#52
File: todo/views/task.py:106-106
Timestamp: 2025-05-29T21:36:27.694Z
Learning: Issue #26 tracks the implementation of user authentication in the todo-backend project, which includes extracting user ID from request context to replace hardcoded placeholders like "system_patch_user" in todo/views/task.py.
Learnt from: AnujChhikara
PR: Real-Dev-Squad/todo-backend#119
File: todo/repositories/task_repository.py:149-154
Timestamp: 2025-07-09T19:59:31.694Z
Learning: In the todo-backend project, per product requirements, tasks marked as deleted (isDeleted=True) should still be returned in user task queries. The get_tasks_for_user method in TaskRepository should not filter out deleted tasks, unlike typical soft deletion patterns.
todo/repositories/task_repository.py (2)
Learnt from: Achintya-Chatterjee
PR: #227
File: todo/repositories/task_repository.py:0-0
Timestamp: 2025-07-23T19:26:43.747Z
Learning: In the todo-backend project, the get_tasks_for_user method in TaskRepository is intentionally designed to return only tasks assigned to the user (not tasks created by them), while the count method includes both tasks created by and assigned to the user. This behavioral difference is by design to serve different use cases.
Learnt from: AnujChhikara
PR: #119
File: todo/repositories/task_repository.py:149-154
Timestamp: 2025-07-09T19:59:31.694Z
Learning: In the todo-backend project, per product requirements, tasks marked as deleted (isDeleted=True) should still be returned in user task queries. The get_tasks_for_user method in TaskRepository should not filter out deleted tasks, unlike typical soft deletion patterns.
🔇 Additional comments (2)
todo/repositories/task_repository.py (2)
49-49
: LGTM: Correct integration of the new team task retrieval method.The change properly replaces the previous direct team assignment logic with the comprehensive method that includes both direct team assignments and member assignments.
118-118
: LGTM: Maintains consistency between list and count operations.The change correctly applies the same comprehensive team task logic to the count method, ensuring that the count accurately reflects the number of tasks returned by the list method.
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Duplicate Task IDs in Team Tasks ▹ view | ✅ Fix detected |
Files scanned
File Path | Reviewed |
---|---|
todo/repositories/task_repository.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
…t/PATCH-API-endpoint ncnnc
…t/PATCH-API-endpoint ncnnc
- Replace inefficient for loops with MongoDB aggregation pipeline - Fix ObjectId/string data type mismatch in task queries - Ensure tasks assigned to team members appear in team todo list - Improve performance by reducing database round trips from N+1 to 1 query - Add proper ObjectId conversion for MongoDB _id field queries
Date:
July 25, 2025
Developer Name: @Achintya-Chatterjee
Issue Ticket Number
Description
TaskRepository
to include tasks assigned to team members in the team's todo list_get_assigned_task_ids_for_team
to aggregate both direct team and member assignmentsDocumentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
postmanScreen.Recording.2025-07-26.at.01.19.10.mp4
swagger
Screen.Recording.2025-07-26.at.01.22.40.mp4
Test Coverage
Screenshot 1
Additional Notes
Description by Korbit AI
What change is being made?
Refactor the logic to show tasks assigned to team members in the team todo list by introducing
_get_assigned_task_ids_for_team
method.Why are these changes being made?
Previously, team todo lists only included tasks directly assigned to a team, not considering tasks assigned to individual team members. This change provides a comprehensive list of team tasks by aggregating both direct team assignments and those of individual team members, thus improving task visibility within teams without duplicating existing code logic.