Skip to content

Conversation

@moseshll
Copy link
Collaborator

@moseshll moseshll commented Nov 6, 2025

  • The issue in a nutshell: CRMS::GetNextItemForReview is placing project-specific result ORDER BY first, overriding the two most critical presentation orders (priority and number of reviews already done) leaving some existing single-review items in limbo.
  • GetNextItemForReview is another monolithic "wall of code"
    • Split the SQL bits of GetNextItemForReview into a new child method select_from_queue_for_user and leave the iteration logic in the original method.
    • Add VERY basic test for each method.
    • The select_from_queue_for_user method is now a good entrypoint for debugging so remove some built-in debugging code (the $test param) into a new utility bin/debug_user.pl
  • Solve the original problem by splitting the @orders array into @critical_order and @noncritical_order. Project orders get sandwiched in the middle. I guess they could go anywhere as long as they aren't unshifted onto the critical array.
  • Testing the added code is a bit of a dilemma. We don't have a bunch of representative data and faking up something that actually exercises code that is intended for largish data sets is a bit of a nightmare.
  • I'm inclined to leave this only superficially tested, and take comfort in the fact that the situation is marginally better than before.

 - The issue in a nutshell: `CRMS::GetNextItemForReview` is placing project-specific result ORDER BY
   first, overriding the two most critical presentation orders (priority and number of reviews already done)
   leaving some existing single-review items in limbo.
 - `GetNextItemForReview` is another monolithic "wall of code"
   - Split the SQL bits of `GetNextItemForReview` into `select_from_queue_for_user` and leave the iteration logic in the original method.
   - Add VERY basic test for each method.
   - The `select_from_queue_for_user` method is now a good entrypoint for debugging so remove some built-in debugging code (the `$test` param)
     into a new utility `bin/debug_user.pl`
 - Solve the original problem by splitting the `@orders` array into `@critical_order` and `@noncritical_order`.
   Project orders get sandwiched in the middle. I guess they could go anywhere as long as they aren't unshifted onto the critical array.
 - Testing the added code is a bit of a dilemma. We don't have a bunch of representative data and faking up something that actually
   exercises code that is intended for largish data sets is a bit of a nightmare.
 - I'm inclined to leave this only superficially tested, and take comfort in the fact that the situation is marginally better than before.
@moseshll moseshll force-pushed the ETT-825_queue_order_by_bug branch from 17a8d36 to 333e0c0 Compare November 6, 2025 20:05
@moseshll moseshll closed this Nov 6, 2025
@moseshll moseshll deleted the ETT-825_queue_order_by_bug branch November 6, 2025 21:17
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