Cinder doesn’t paginate

I’m trying to get cinder to paginate but it shows all data regardless. Cinder version: 0.5.5 <Cinder.Table.table page_size={[default: 25, options: [10, 25, 50, 100]]} resource={MyApp.MyResource} actor={@current_user} > According to the doc, it should be sufficient to paginate. What am I missing?
Solution:
Does your resource definition enable pagination for the relevant action?
Jump to solution
15 Replies
Solution
frankdugan3
frankdugan32mo ago
Does your resource definition enable pagination for the relevant action?
sevenseacat
sevenseacat2mo ago
how many records are there to display?
Dan
DanOP2mo ago
@Rebecca Le Tens of thousands. But since it refuses to paginate it crashes out of memory so I artificially limited them to 100 in the resource and it shows all 100 with no pagination.
sevenseacat
sevenseacat2mo ago
🤔
Dan
DanOP2mo ago
I have another resource in the millions. You really need the filters to get something useful in that app. Anything I can do to debug what’s happening?
frankdugan3
frankdugan32mo ago
Is pagination enabled in the resource for the action you're using in the table?
Dan
DanOP2mo ago
Oh… Nope, didn’t enable it in the resource. I thought it was happening in the table. That explains things.
sevenseacat
sevenseacat2mo ago
you should have gotten a warning about that nothing in the logs?
Dan
DanOP2mo ago
Nothing. query that identifies me with ash auth, query that fills the table, nothing in between
sevenseacat
sevenseacat2mo ago
thats surprising, there should be a warning like 00:04:01.619 [warning] Cinder loaded 1 records for non-paginated action :by_name. Consider enabling pagination on this action for better performance.. i'll look into why that might not be happening
Dan
DanOP2mo ago
While cinder is loading, it displays “loading”, can I translate this?
sevenseacat
sevenseacat2mo ago
you can specify the loading_message option on the table
Dan
DanOP2mo ago
Neat.
sevenseacat
sevenseacat2mo ago
found the issue - we're not correctly checking for pagination on the action, we were only logging an error when the number of records was over a certain threshold (which your initial query was, but then that crashed) this is fixed in main now 🙂
Dan
DanOP2mo ago
Yeah, quite over. 🤣

Did you find this page helpful?