pagination updates doesn't show records by most recently published #62

Open
opened 2024-11-04 20:53:20 +00:00 by zramsay · 2 comments
Member

previously, the console showed the most recently published records. the recent pagination updates are nice but they don't sort very well.

for example, i go to: https://console-sapo.laconic.com/#/registry and can't see the latest records and can't figure out how to see the record i just published

previously, the console showed the most recently published records. the recent pagination updates are nice but they don't sort very well. for example, i go to: https://console-sapo.laconic.com/#/registry and can't see the latest records and can't figure out how to see the record i just published
Member

In laconic-console, the fetched records are sorted by createTime on the client side. Because of this, we are able to see latest records first in older console as it fetches all the records at once.

Whereas in the new console with pagination, we only fetch page-size number of records for a particular page which then get sorted in the console; and these records may not include the latest records. We are using cosmos-sdk's inbuilt pagination, which returns results sorted on the collection's key (in this case the record id).

For having the desired effect of having records paginated and sorted by createTime, we'll have to create an index on createTime and implement the pagination part "manually" (deviating from the standard pattern) as pagination when iterating on on an index is not supported.

In laconic-console, the fetched records are sorted by `createTime` on the [client side](https://git.vdb.to/cerc-io/laconic-console/src/branch/main/src/containers/panels/registry/RegistryRecords.js#L72). Because of this, we are able to see latest records first in older console as it fetches all the records at once. Whereas in the new console with pagination, we only fetch page-size number of records for a particular page which then get sorted in the console; and these records may not include the latest records. We are using cosmos-sdk's inbuilt pagination, which returns results sorted on the collection's key (in this case the record id). For having the desired effect of having records paginated and sorted by `createTime`, we'll have to create an index on `createTime` and implement the pagination part "manually" (deviating from the standard pattern) as pagination when iterating on on an index is not supported.
Author
Member

oh man, software is hard :(

oh man, software is hard :(
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/laconic-console#62
No description provided.