Aiven-Open / klaw

Klaw, the latest OS tool by Aiven, helps enterprises cope with Apache Kafka(r) topics, schema registry and connectors governance by introducing roles/authorizations to users of various teams of an org.
https://www.klaw-project.io/
Apache License 2.0
150 stars 60 forks source link

🐛 pagination not working for coral #1770

Closed programmiri closed 1 year ago

programmiri commented 1 year ago

This is a bug that was likely introduced with PR Introduce reusable pager.

Angular now sends an encoded > (or <, >>, <<) to the endpoints (e.g. /getTopics) now, which works with the new Pager.

Coral sends the pageNo still as "2" etc. There is no error returned for this, just the same list for page "1".

Todo

Since it's more common to send a number than a character as a pageNo, (I think), I think it would make sense to either change Pager in a way to handle both or to handle only numbers (well, integers send as strings) and change Angular api call accordingly.

Also we should think about how we can avoid breaking api changes in the future, there was no way this could have bubbled up to us through typing etc.

mathieu-anderson commented 1 year ago

This kind of addition to Pager seemed to take care of the issue when I tried it locally, but I don't know itf it's very idiomatic to handle it in this way ^^'

https://github.com/Aiven-Open/klaw/blob/1322308bc30c96c0a696d97afcbff6c9aa1a27c6/core/src/main/java/io/aiven/klaw/helpers/Pager.java#L12-L14