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

Set stateDuration to 0 for all saved datatables to store the state indefinitely #1944

Merged
merged 6 commits into from
Oct 27, 2021

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Oct 27, 2021

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)
  • I have Signed Off all commits. (git commit --signoff)

What does this PR aim to accomplish?:

We already save the state of the datatables in the local storage. However, we didn't set stateDuration explicitly, which make the option default to 7200 seconds (2h).
https://datatables.net/reference/option/stateDuration

Afterwards, datatables will consider the state invalid. This means, that despite having chosen non-default options for the datatables (which is still present in the local storage), on load they will fall-back to their default values and overwrite all previously chosen settings.

This has been reported here: #764 (comment)


Additionally, this PR removes some duplicated code that has been moved to the utils.stateLoadCallback function before.

This reverts commit 2f54f5f.

Signed-off-by: Christian König <[email protected]>
This reverts commit 6a3e778.

Signed-off-by: Christian König <[email protected]>
@yubiuser
Copy link
Member Author

Sorry for the mess - forgot to sign-off one intermediate commit and DCO didn't stop complaining.

@yubiuser yubiuser marked this pull request as ready for review October 27, 2021 19:03
@yubiuser
Copy link
Member Author

Tried it multiple times >2h and manual changes kept applied.

@yubiuser yubiuser added the PR: Approval Required Open Pull Request, needs approval label Oct 27, 2021
@PromoFaux
Copy link
Member

Tried it multiple times >2h and manual changes kept applied.

Thanks, I meant to pull this earlier to test exactly that, but I've read the documentation and what you've seen matches what we would expect to see, so I am happy to take your word for it

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-12-web-v5-9-and-core-v5-7-released/51795/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Approval Required Open Pull Request, needs approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants