Skip to content

[#14332] Optimize GetFeedbackSessionsAction#14333

Draft
TobyCyan wants to merge 2 commits into
TEAMMATES:masterfrom
TobyCyan:optimize-getfs
Draft

[#14332] Optimize GetFeedbackSessionsAction#14333
TobyCyan wants to merge 2 commits into
TEAMMATES:masterfrom
TobyCyan:optimize-getfs

Conversation

@TobyCyan

@TobyCyan TobyCyan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Part of #14332

Outline of Solution

  • Reduced db calls
    • Student: 1 + number of courses + number of sessions -> 3.
    • Instructor: 1 + 1 + number of sessions -> 3.
  • Add tests.

Local Benchmarking Results after Seeding the DB
image

@samuelfangjw

Copy link
Copy Markdown
Member

@TobyCyan This action has not been cleaned up, so this is not a prime candidate for optimisation work. Since you are already working on this, maybe you can help clean it up instead.

  1. Separate student and instructor API. GetStudentFeedbackSessionsAction and GetFeedbackSessionsAction. The student variant will be used by students, the generic variant will be used by admins and instructors.
  2. On the frontend, there should only be 2 service methods. One for instructor and one for student. Remove all other variants.
  3. Separate filter for sessions in recycle bin (only for instructors). This will be extended in the future to support more filters and search.
  4. Remove courseId == null option for students. Students have to specify exact courseId for now.
  5. For instructors and admin, accept a list of courseIds. Then construct a query object (ref StudentQuery). Use the query object to query the DB. All filters in the object are optional.
  6. No more implicit scoped to user results. Instructor pages should fetch the list of courses then explicitly specify the list of courseIds instead of deriving this from context. Verify that the account is valid for each courseId.
  7. For generic API, only admins are allowed to get a list of feedback sessions without a courseId filter. This will return all feedback sessions. We will add a search and filter option in the future.
  8. Logic pushed down to logic layer, keep API layer thin.

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.

2 participants