Repository: provectus/kafka-ui
Issue: Messages filtering by offset & timestamp doesn't work
Labels: type/bug
scope/frontend
status/accepted
status/confirmed


![1](https://user-images.githubusercontent.com/75166592/228173520-d2fa1a0b-183d-4a4c-aec4-f53396f6ba99.JPG)
![2](https://user-images.githubusercontent.com/75166592/228173528-52b58854-1e51-402f-b0a2-0b5a5fb2a78f.JPG)

when we use all partitions, the filter does not work.
when we use certain partitions, the filter works

Issue comments:
Hello there seralyzh! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀
Hi, can you verify that it works now with `latest` tag?
Hi,

It works now for the timestamp filter now.
But the seek by offset is still broken 
`{"code":4002,"message":"seekTo should be set if seekType is OFFSET....}.`

Also paging does not work : going to next page always returns the same page (got an NS_ERROR_ABORT and then reload) Should I create a new bug for this ?
Thanks.
This issue has been automatically marked as stale because no requested feedback has been provided. It will be closed if no further activity occurs. Thank you for your contributions.

Pull request review comments:
Correct me if I'm wrong: seekTo exists in the query only with this seek types?
@Haarolean @iliax 
@NeiruBugz yep that's right
doesn't this give us the issue where we had all the partitions selected, now the first part of the `if` condition is `false` but the second one because we are using `OR` will be true hence we will have that `url` length issue again during `offset` and `timestamp`
@Mgrdich 
hi, this is my suggestion https://github.com/provectus/kafka-ui/issues/3525 to solve the `url length isssue`. could you teams review it?
Hey @Mgrdich
I've made a short review of the @p-eye solution for not combining offset with partition - it seems this one should work fine, but it probably needs some task on the backend to support this kind of payload and a bit of refactoring on the client side
@Haarolean if @p-eye suggestions of the seek error is going to be implemented in the future , it is okay for me with that change.
@Mgrdich the suggested change doesn't work well with pagination. The decision, for now, is to fix search modes considering that we might break the URL length fix.

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Messages/Filters/Filters.tsx
index f9fa3401fc0..c5be097dad6 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Messages/Filters/Filters.tsx
@@ -231,9 +231,13 @@ const Filters: React.FC<FiltersProps> = ({
         props.seekType = SeekType.TIMESTAMP;
       }
 
+      const isSeekTypeWithSeekTo =
+        props.seekType === SeekType.TIMESTAMP ||
+        props.seekType === SeekType.OFFSET;
+
       if (
         selectedPartitions.length !== partitions.length ||
-        currentSeekType === SeekType.TIMESTAMP
+        isSeekTypeWithSeekTo
       ) {
         // not everything in the partition is selected
         props.seekTo = selectedPartitions.map(({ value }) => {


Test patch: