Skip to content

Browse: Next stays disabled on a remembered last page after the table grows #1940

Description

@dawsontoth

Problem

DatabaseTableView remembers a page it has proven to be the last (knownLastPage, src/features/instance/databases/components/DatabaseTableView.tsx:375). That keeps Next from offering a probe already known to come back empty. The proof is reset only by its own deps (database, table, filters, page size, cache mode) and by the view's own refreshTable.

Anything else that refreshes the grid's data leaves the proof standing, even though the table may have grown: a window-focus refetch, an import finishing (#1938 refreshes the queries from the import mutation), another tab or user inserting records. So someone who paged to the end, and then imports or adds records, can find Next stays disabled on that page until they press Refresh.

Ask

Clear knownLastPage whenever the page query's data changes from a refetch, not only on the view's own refresh. For example, key it on the query's dataUpdatedAt, or reset it when the record count grows. Test it with an import or outside refetch after reaching the last page.

Raised by the cross-model review of #1938; pre-existing, not changed by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions