Skip to content

Fix mass-deletion of sessions on the settings -> API page#2765

Merged
DL6ER merged 3 commits into
development-v6from
fix/session_delete
Oct 27, 2023
Merged

Fix mass-deletion of sessions on the settings -> API page#2765
DL6ER merged 3 commits into
development-v6from
fix/session_delete

Conversation

@DL6ER

@DL6ER DL6ER commented Oct 19, 2023

Copy link
Copy Markdown
Member

What does this implement/fix?

See title and related Discourse topic.

Related issue or feature (if applicable): N/A

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.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER requested a review from a team October 19, 2023 17:07
@PromoFaux

Copy link
Copy Markdown
Member

Something not quite right here. Sometimes it deletes all but one session. Seems a bit random as to which session gets left over.

notquite

@yubiuser

Copy link
Copy Markdown
Member

Maybe it's an issue with ownSessionID

@rdwebdesign

rdwebdesign commented Oct 22, 2023

Copy link
Copy Markdown
Member

I wasn't able to replicate the "all but one" issue using different browsers (Chrome, Firefox and Edge) on the same machine.

You used different windows from the same browser (using incognito mode). I'm not sure if this could be related to the issue you are seeing. We probably need more tests.

@DL6ER

DL6ER commented Oct 24, 2023

Copy link
Copy Markdown
Member Author

The issue was the concurrency of the deletions. This is fixed by the latest commit

…ls finished. This also ensures our own session is NOT deleted on error so the user can still see the generated error message

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER force-pushed the fix/session_delete branch from 5e3f2ca to 7595ceb Compare October 24, 2023 17:39
@yubiuser yubiuser requested a review from PromoFaux October 24, 2023 20:03

@yubiuser yubiuser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have 3 functions now with very similar names: deleteSessions(), delSessions(ids) and delSession(id,...). The first one does not do much on it's own, maybe the single line var ids = [$(this).attr("data-del-id")]; can be part of delSessions()?

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER merged commit 85266fe into development-v6 Oct 27, 2023
@DL6ER DL6ER deleted the fix/session_delete branch October 27, 2023 20:10
@PromoFaux PromoFaux mentioned this pull request Feb 18, 2025
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.

4 participants