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

Navigator will not be updated when content changes #707

Open
skyjou opened this issue Oct 17, 2024 · 3 comments
Open

Navigator will not be updated when content changes #707

skyjou opened this issue Oct 17, 2024 · 3 comments

Comments

@skyjou
Copy link

skyjou commented Oct 17, 2024

Describe the bug
Navigator will not be updated when content changes.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Thold'
  2. Click on 'Device Status'
  3. See error

Expected behavior
Navigator will be updated when content changes.

Plugin:

  • Version: 1.8.1
  • Source: GitHub

Desktop:

  • OS: Ubuntu 24.04
  • Browser: Chrome, Firefox

Additional context
It seems that the get_total_row_data() function causes the navigator to cache outdated information for 86400 seconds.

@skyjou skyjou changed the title Navigator will not be updated with content changes Navigator will not be updated when content changes Oct 17, 2024
@xmacan
Copy link
Member

xmacan commented Oct 17, 2024

Cannot reproduce this. Try to update to 1.8.2, it was released yesterday

@skyjou
Copy link
Author

skyjou commented Oct 17, 2024

I just upgraded to the new version. The issue still exist:

Screenshot from 2024-10-17 14-59-31

There are 8 not-up devices, but the navbar shows 7 only.

@skyjou
Copy link
Author

skyjou commented Oct 17, 2024

If I change line 8072 in thold_functions.php from:
$total_rows = get_total_row_data($user_id, $sql, array(), 'thold_device');

to:
$total_rows = get_total_row_data($user_id, $sql, array(), 'thold_device', 10);

or:
$total_rows = db_fetch_cell($sql);

Narbar can update correctly, but this is not a good solution.
The narbar total_rows should be cached only before the next poller run, or just not cache it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants