-
-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix gravity count when FTL fails to return this value #3160
Conversation
When FTL fails to count the number of domains on the lists, the value -2 is returned, but this value should not be printed (it's just an error code). Signed-off-by: RD WebDesign <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see were this is coming from, but I wonder if '-2' is not the better choose as it also indicates database failures/issues and not only empty gravity lists.
In my opinion it is wrong to show If we need to indicate a database failure, then we need to show an error message somewhere. In this case, // Get number of domains in a specified table of the gravity database We return
// the constant DB_FAILED and log to FTL.log if we encounter any error
int gravityDB_count(const enum gravity_tables list)
{
... and |
Maybe we should show 0 and log an error to the message table as well? @DL6ER |
Yes.
|
FWIW my feeling is that edit https://discourse.pi-hole.net/t/2-domains-on-blocklist-after-updating-pihole/73626/ is the context |
This is 100% true for the API, but not for the user interface. From the UX point of view, |
But would the user understand if and why it suddenly shows that there are As I mentioned in my initial post on Discourse, pihole was still working and blocking queries as expected. IMHO it would be most helpful, if
|
Maybe we could show |
I think I was able to achieve all goals. Now in case of an error:
I'm don't think we need a message in diagnosis page, but in any case this should be done in FTL repo and is out of the scope of this PR. |
- show an error message including the error code; - change the title (tooltip) text Signed-off-by: RD WebDesign <[email protected]>
40c5fb8
to
8308057
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this PR aim to accomplish?
Fixes the
-2 Domains on the Lists
issue.How does this PR accomplish the above?
When FTL fails to count the number of domains on the lists, the value
-2
is returned, but this value should not be printed.This PR shows
0
in this case.Link documentation PRs if any are needed to support this PR:
none
By submitting this pull request, I confirm the following:
git rebase
)