sterrenb / flutterhole

A third party Android application for the Pi-Hole® dashboard.
https://play.google.com/store/apps/details?id=sterrenburg.github.flutterhole
MIT License
400 stars 27 forks source link

Listing client's queries works randomly #95

Open fusionjack opened 4 years ago

fusionjack commented 4 years ago

Describe the bug Listing client's queries works randomly. For queries below 1000, it always works. For queries above 1000, it is random. Sometimes, it works with 10k queries, but not with 2k queries.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Dashboard'
  2. Tap on 'Client icon'
  3. Tap on a client with >1k queries
  4. If it doesn't work, queries are not shown, only loading icon, even I have waited for >2 minutes.

Expected behavior Queries are shown like in the older version 2.x of FlutterHole, no matter how big the queries are.

Versions

Additional context This issue might be related with the number of distinct queries. Even the number of queries is 10k, but the number of distinct queries might be much lower. I noticed this as I have a client which sends some same queries until it reaches >10k within a couple of hours. For other client who has >2k queries, they might have many distinct queries.

sterrenb commented 4 years ago

Hello @fusionjack 👋 - Thanks for opening an issue!

If I understand correctly, does the single client popup page keep loading in some instances?

As an aside, I noticed that for large query counts, my Pi-hole struggles a bit. It sometimes takes a while to get a large amount of queries, say 10k+. But I guess that depends on your Raspberry performance too.

fusionjack commented 4 years ago

Yeah, the performance of pihole for big count of queries is not that good, but as the older version 2.x of flutterhole can list them, so I think the issue might be in the new version 5x of flutterhole. Maybe you can compare the old and the new version how they fetch the queries. What do you mean with "keep loading in some instance"?

Yidaotus commented 4 years ago

I have noticed the same Issue. On further inspection it seems the response from the api is always the same if you go above N queries for a user. So further queries get ommited.

Since the replies are listed in ascending order (by timestamp) in the reply body, you will always see the n oldest.

Is there an api endpoint and/or query parameter to get the replies in descending order maybe?

sterrenb commented 4 years ago

What do you mean with "keep loading in some instance"?

@fusionjack I meant, does the query log page stay in the "loading state" (i.e. showing a loading indicator)? That could indicate that your Pi-hole is processing the query data for a while, but that is just a hunch.

Is there an api endpoint and/or query parameter to get the replies in descending order maybe?

Since no "official" documentation exists for the API, I mostly figured it out by looking at the source and trying things out. I'm not aware of requesting ascending/descending order, but it might be possible.