Skip to content

Conversation

@moseshll
Copy link
Collaborator

@moseshll moseshll commented Nov 6, 2025

This seems to be about the smallest bugfix PR I am capable of producing. Has been tested on dev-2 against the production database and the results are now correct.

  • Fix ordering in CRMS::GetNextItemForReview
    • Split ORDER BY parameters into "critical" and "noncritical"
    • Any project-supplied ORDER BYs get prepended to the noncritical array.
  • Remove obsolete comment.
  • Add params arrays for both of the new arrays to address an existing (and commented-on) parameter land mine. This helps ensure clauses and their parameters get assembled in the right order.
  • Add a very basic test for GetNextItemForReview that, alas, doesn't really test the bugfix, just that the code can still produce a correct output.

For the Reviewer

In a nutshell, CRMS is calling SELECT ... FROM queue WHERE ... with a bunch of ORDER BY constraints and the optional ORDER called $porder needs to be in the middle of the list. Hence the split into "critical" and "noncritical".

The added @critical_order_params and @noncritical_order_params is insurance against future bugs, it is not really part of the bugfix. The existing parameter handling was just... not nice.

 - Minimal correct modification to `CRMS::GetNextItemForReview` I could come up with
   - Split `ORDER BY` parameters into "critical" and "noncritical"
   - Any project-supplied `ORDER BY`s get prepended to the noncritical array.
- Remove obsolete comment.
- Add `params` arrays for both of the new arrays to address an existing (and commented-on)
  parameter land mine. This helps ensure clauses and their parameters get assembled in the
  right order.
@moseshll moseshll marked this pull request as ready for review November 7, 2025 19:33
@moseshll moseshll requested a review from liseli November 7, 2025 21:15
Copy link

@liseli liseli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve this PR because the change make sense.

@moseshll moseshll merged commit 690b10a into main Nov 10, 2025
1 check passed
@moseshll moseshll deleted the ETT-825_queue_order branch November 10, 2025 16:35
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.

3 participants