Skip to content

fix: use a unique tie-breaker for learning path pagination - #72

Closed
lifeofgurpreet wants to merge 1 commit into
open-craft:mainfrom
lifeofgurpreet:fix/stable-learning-path-pagination
Closed

lifeofgurpreet wants to merge 1 commit into
open-craft:mainfrom
lifeofgurpreet:fix/stable-learning-path-pagination

Conversation

@lifeofgurpreet

Copy link
Copy Markdown

Equal enrollment dates and the NULL dates of non-enrolled paths currently have no unique ordering term. Add the immutable path id after descending enrollment date / NULLs last, preserving visibility and the existing leading sort order while giving paginated lists a total order.

The focused tests cover staff/non-staff visibility, equal dates, NULL dates and page membership. They also require a unique term in the actual ORM ordering: small SQLite fixtures can coincidentally return ID order even when the fix is absent. Removing the tie-breaker fails both tests.

Validation (Python3.12 / Django5.2.13, native package/models/migrations): the two new tests and the existing image-replacement test pass. A broader models run has three existing audit-factory DoesNotExist failures; it is not claimed as green. Ruff F checks, diff checks and scoped UBS (0 critical / 0 warning / 59 info) pass. No CI wait or runtime/tenant acceptance is claimed.

Preserve enrollment-date ordering and visibility while ordering equal and NULL dates by the immutable path ID. Cover staff/non-staff page membership and require a unique ORM ordering term, so incidental SQLite row order cannot hide the regression.
@lifeofgurpreet

Copy link
Copy Markdown
Author

Same-environment comparison confirms the broad-suite failures are inherited: unmodified main51d927f has14PASS/3audit-factory DoesNotExist failures; the proposed head dc6c08f has16PASS/the same3failures. The two new pagination tests and existing image replacement pass; removing the unique ordering term fails both new tests. No full-suite pass claimed.

@Agrendalath

Copy link
Copy Markdown
Member

Ordering is already implemented in #71. Closing.

@Agrendalath Agrendalath closed this Oct 5, 2026
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