Repository: provectus/kafka-ui
Issue: Timestamp filtering is broken
Labels: type/bug
scope/frontend
status/accepted

**Describe the bug**
<!--(A clear and concise description of what the bug is.)-->
On trying to search for logs for a specific date, or using a keyword(some text relevant to a log). The search results in incorrect result set. 

**Set up**
<!--
(How do you run the app? 
Which version of the app are you running? Provide either docker image version or check commit hash at the top left corner. We won't be able to help you without this information.)
-->
      Version: e85e1aafa1250573a8056bf14ee4003d3179cbae
      App is run : Pod inside EKS cluster




**Steps to Reproduce**
Steps to reproduce the behavior:

1. Open the Kafka-UI
2. Navigate to a Kafka topic
3. Within the selected Kafka topic, navigate to Messages tab
4. Try to search using a timestamp, for example current date
5. Try searching with some text you wish to fetch the log result containing it
6. In both the above selections, incorrect result is rendered
7. Refer screenshot attached

**Expected behavior**
<!--
(A clear and concise description of what you expected to happen)
--> 
       1. If I enter search parameter as timestamp=17th march, 2022, I should be able to fetch message logs only for 17th March
          Currently, result rendered contains logs from feb, refer screenshot
       2. If I enter search parameter as some keyword(text), it does not filter and render the result logs containing just the searched 
           keyword, it renders all the data by default


**Screenshots**
<!--
(If applicable, add screenshots to help explain your problem)
-->
![image](https://user-images.githubusercontent.com/86369243/159298665-4d28f1c6-e75d-4d69-aab3-8403b4c0a199.png)




**Additional context**
<!--
(Add any other context about the problem here)
-->


Issue comments:
Hello there prajaktar1! 👋

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. 👀
Hey, thanks for reaching out. We'll take a look.
@Haarolean Is it ok if i look into this issue ?
@gaddam1987 yep, would be nice!
The issue is in react app, the callback on submit of the filter (this function https://github.com/provectus/kafka-ui/blob/master/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx#L181) is not able to use the fields set in the search criteria. The search always contains default search params irrespective of what we choose.

I don't know why this happens i am not React guy but just going through react to fix this. Will try my best to fix this in this week :)
@prajaktar1 I fixed the issue, you can checkit out from this pull request https://github.com/provectus/kafka-ui/pull/1781 and see if that works, i have tested from my side and it worked.

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
index 69d1159aaef..84aaa0c7629 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
+++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Messages/Filters/Filters.tsx
@@ -208,7 +208,14 @@ const Filters: React.FC<FiltersProps> = ({
       search: `?${qs}`,
     });
     // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, [seekDirection, queryType, activeFilter]);
+  }, [
+    seekDirection,
+    queryType,
+    activeFilter,
+    currentSeekType,
+    timestamp,
+    query,
+  ]);
 
   const toggleSeekDirection = (val: string) => {
     switch (val) {


Test patch: