Conversation
hasPreviousPage and hasNextPage compare a page with the oldest and newest post its list can show, but that lookup ignored the list's filter and used all published posts. Author, label, featured and search lists therefore reported pages that did not exist. Apply the list's condition and join to the lookup as well. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TwoDCube The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug recorded by the tests in #247. Stacked on #252 (base
fix/posts-empty-list), so this is a draft until #246, #247 and #252 merge. The dependency is real: without #252, applying the filter would make every empty filtered list, such as a label with no posts, fail withCould not get min value.Bug
hasPreviousPageandhasNextPagecompare a page with the oldest and newest post its list can show. That lookup ignored the list's filter and used all published posts. As a result,author.posts,label.posts,posts(featured: true)andsearchreported pages that did not exist: the only post labelled "Sport" came back with both flagstrue.Fix
get_listed_posts_min_max_id) takes the list's condition and join, and counts only published posts matching them, like the list itself.RelationDefis notClone.create_paginated_poststherefore takesOption<fn() -> RelationDef>, andlabels.rspasses a closure.build_paginated_postsis unchanged, to stay out of fix: page through posts by date and id so backdated posts are not skipped #251's diff.Tests
page_info_of_a_filtered_list_reflects_the_filteris no longer ignored.frontend_queries__search_page_by_authorandfrontend_queries__search_page_by_label,hasPreviousPagechanges fromtruetofalse: both pages already contain the oldest post of their list. This is the intended change. website_frontend2 requests the field but does not act on it yet.cargo clippy --workspace --all-targets -D warningsis clean.CI=true cargo test --workspacepasses against MySQL 8.4 and Redis 6.2.🤖 Generated with Claude Code