Red Hat Bugzilla – Bug 489318
TPS "List Activites" - does not list activities after 20 entries??
Last modified: 2015-01-04 18:37:04 EST
Description of problem:
In the TPS "List Activities"(for any of the Admin, Agent and operators), more than 20 activities are not listed.
After 20 entries, when I add a user, the new action(the now newly added uer) does not show up under the "Activites List" . But the "Total" counter at the bottom increases.
Newly added activities after 20 entries does not show up. But the "Total" counter increases.
Activites after 20 entries should be listed.
Logs does not reveal much.
Please let me know if more information is required.
Created attachment 335625 [details]
patch to fix
Fix this simply as follows:
1. Allow to return a maximum of 100 results for a non-search return (instead of 20).
2. Add pagination (25 entries per page)
3. Return the latest 100 activity logs (now in reverse order) for non-search.
cfu, please review.
attachment (id=335625) +awnuk (under assumption "doCancel()" is removed)
[builder@dhcp231-124 tps-ui]$ svn ci -m "Bugzilla 489318 TPS does not list more than 20 activities"
Transmitting file data ........
Committed revision 314.
[builder@dhcp231-124 tps]$ svn ci -m "Bugzilla 489318 TPS does not list more than 20 activities" pki-tps.spec ../../base/tps/
Transmitting file data ..
Committed revision 315.
I was doing some searches.
- main menu - agent operations - search activities
- max count : 200
- 1st page returned: 200 of 504 ( I guess I have 504 total activities as max)
- 2nd page returned: 200 of 504.
- 6th page(last page shown )returned: 164 of 504. The number reported
seems bogus to me.
Created attachment 347606 [details]
patch to fix2
patch to finally fix pagination.
In the past, there was no pagination and so the size of the buffer injection was set by a heuristic as follows:
After the first entry is added to the injection - determine the size of the injection and multiply that by the total number of entries (up to a maximum size)
So, if the total number of entries was 10 000, then the size of the buffer would be roughly 10 000 * sizeof(one entry + header)
We now have pagination - so we do not return all the entries at once. So the above algorithm makes no sense. Instead, we check after each entry and grow the buffer (up to a maximum size) as needed.
Before, the variable "limited" made sense because the number of entries returned was limited by the largest buffer size. If there were 10000 entries, but the max buffer size only allowed the display of 2000 entries, then we needed to say "2000 of 10000" entries. The downside of course was that it was not possible to find the remaining entries..
With pagination, this is no longer a limitation. The number of entries per page is limited to 25 - so we can display all of them - albeit in little batches at a time. "limited" now refers to the size of maxReturns as defined by the user. ie. if I do a search on certificates, and the search returns 100 certs and I have designated a maxReturn of 50 , then it will say 50 of 100.
Obviously, if the number of max returns is less than the number of search results -- it will just list the number of search results.
This does not work for searches on tokens, where maxReturns is used to limit the size of the search results returned. Thats probably the right thing to do for other searches -- but I'm not going to touch that now.
awnuk, please review
attachment (id=347606) +awnuk
It would even nicer to have an option to enter page size from UI.
CA is already handling page size this way.
Will add UI option in later bug.
[builder@dhcp231-124 pki]$ svn ci -m "Bugzilla Bug #489318 - TPS List Activites - does not list activities after 20 entries - fix pagination"
Transmitting file data ..
Committed revision 586.
Listing activities max is 100 and displays 25 per page
Searching activies with 516 activities:
max 100 - displays 100 - 25 per page - 100 of 516 displayed at bottom of each page
max 525 - displays all - 25 per page - last page displays last 16 - Total:516 displayed at bottom of each page