Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin transfers page: db paging update #1433

Merged

Conversation

monkeyiq
Copy link
Contributor

This is an update to #1425

Thanks @makinog3 for the above PR which inspired me to tinker on these updates!

It allows a fake $total_count if the offset is zero and there are no real selectors in the SQL query. This is the case for when you first view the admin / transfers page and the totals are likely to be large, somewhat uninteresting, and maybe slow (seq scan on the transfers table).

I have also limited the scope of the for clause to only consider pages near the current offset rather than from 0 to $total_count.

@github-actions
Copy link

If there are selenium UI results for this code they will be at filesenderuici@4aa4a3b

@monkeyiq
Copy link
Contributor Author

On further thought the $total_count might not be needed. That query really just wants to know if there are entries before and after the $offset. Something like the following but with bounding for ensuring that offset does not go negative. Seems like a good idea for a subsequent PR at some stage.

        'count'  => $page_size * $display_page_num,
        'offset' => $offset - $page_size * $display_page_num/2,

@monkeyiq monkeyiq merged commit bf44f54 into filesender:development Apr 16, 2023
6 checks passed
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.

None yet

1 participant