Skip to content
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 (and simplify) mass deletion of several tables #3034

Closed
wants to merge 1 commit into from

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented May 30, 2024

What does this implement/fix?

Fix (and simplify) mass deletion of DHCP lease, diagnosis messages, and local DNS/CNAME records


Related issue or feature (if applicable): see Discourse thread

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

@DL6ER DL6ER requested a review from a team May 30, 2024 10:44
Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, there is no mass-deletion of local DNS/CNAME records at all.

Screenshot at 2024-05-30 14-15-04

@DL6ER
Copy link
Member Author

DL6ER commented May 30, 2024

@yubiuser You are right, for this table only the "(and simplify)" part applies

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causes a 'undefinded' message to pop up when more then one item is deleted. Also the count is off: when more then one item is deleted it will always success with 1 item deleted, except when only the last item in a table is deleted it will show 2 items deleted

Screenshot at 2024-06-01 21-33-28

@DL6ER
Copy link
Member Author

DL6ER commented Jun 2, 2024

@yubiuser looking at this, this is actually not a new bug but in fact a more general bug of our toast notification system. Previously, we printed a single toast for deleting multiple entries and updated this on success/fail. Now we print individual toasts but can only update the last one (due to this aforementioned limitation). I guess we need to cluster again but - as the deletion events get fired async and individually, I'm not actually sure what would be the best Javascript handling to actually report about errors or success.

@rdwebdesign
Copy link
Member

Why do we need the initial blue message saying "Deleting message..." and then update the message?

I think we could simply show the final message (success or error).

@yubiuser
Copy link
Member

yubiuser commented Jun 2, 2024

I think we have all those "doing xxx" messages because on slower devices it might need some time before the operation finished and success/failure is displayed. So the users know their click triggered an action.

@rdwebdesign
Copy link
Member

Hmmm...
Do we need to update the initial message?

In other words: can we simply display one toast with the initial "Doing xxxxxx..." message and when the answer is received we display another toast with the final message (not updating the initial one)?

@yubiuser
Copy link
Member

yubiuser commented Jun 2, 2024

This should be fine I guess.

@rdwebdesign
Copy link
Member

@DL6ER

You have a related PR (at least in part) where you made some changes to showAlert(). I think that changes were intended to fix the toast issues we are seeing above.

@DL6ER
Copy link
Member Author

DL6ER commented Jun 3, 2024

Oh, more than half a year ago PR which totall escaped me. Closing this one as it is a duplicate. I will port the changes into the older PR and rebase it on latest development-v6.

@DL6ER DL6ER closed this Jun 3, 2024
@DL6ER DL6ER deleted the fix/mass_delete branch June 3, 2024 07:36
@DL6ER DL6ER mentioned this pull request Jun 3, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants