You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue with opensak.filter not refreshing the grid #1325
I have been trying to reproduce this one consistently but I can't. I am finding that a lot of time since maybe beta 3 o4 4 that in the attached macro with the attached database the cache list does not refresh for the right caches. I am pretty certain it is just a list refresh issue because opensak.filter always returns the correct number of records when I log that. I have been using filter words of rusty and lime and bridge. I feel it is a refresh issue because also the html comes back with the correct list. Also, the list shows a highlighted red x in the toolbar even though all caches are shown. I cannot always reproduce this behavior.
The database zip is failing to upload. Is there an alternative way to send? File is 35 mb
Steps to Reproduce
Try running the macro again and again using one of the three words I gave each time and sometimes clearing the filter between runs and sometimes not. Eventually I get in a situation where the grid will always show all caches.
Expected Behavior
The grid should only show the correctly filtered caches
Environment
Windows 11 Pro 10.0.26300 Build 26300. Opensak OpenSAK 1.23.0-beta.5
I tried making a smaller database by copying my original database and deleting some of the caches from it, but on the smaller database I cannot reproduce the issue. I'm not sure if the problem is related to database size or maybe my test database is corrupt in some way.
More information. I commented out line 694 of the macro because the clear_filter was really not necessary and now I can no longer reproduce the issue. Very strange.
@GeePa67 Thanks for the detailed report. I could reproduce this reliably on 1.23.0-beta.5, and your finding about line 694 was the key clue.
As this is a race condition bug, there is no 100% certainty, but maybe you can confirm the below and later the fix in the next beta. Cause
It's a race between opensak.clear_filter() and opensak.filter{}:
clear_filter() starts loading the whole, unfiltered list in the background.
opensak.filter{} fills the grid right away with the correct result. That's why the count it returns and your HTML are always right.
When the macro finishes, the unfiltered list from step 1 arrives late and overwrites the grid with all caches. The filter is still active, so the red ✕ stays lit.
Why it's intermittent opensak.progress lets the app process pending events while your loop runs. If the background load finishes during the loop, it arrives before filter{} and does no harm. If it finishes after the last progress update, it overwrites the filtered list. Loading every cache from a large database takes longer, so the bug shows up much more often there than on a small test copy.
Workaround
Until it's fixed, leave out the opensak.clear_filter() call, as you already found. Your macro reads the caches with opensak.caches{} before that line anyway.
Fix
Applying a filter should discard any list load that is still running, so a late result can't overwrite it. I'll prepare a fix with a regression test.
Activity
GeePa67 commentedon Nov 16, 2026
I tried making a smaller database by copying my original database and deleting some of the caches from it, but on the smaller database I cannot reproduce the issue. I'm not sure if the problem is related to database size or maybe my test database is corrupt in some way.
GeePa67 commentedon Nov 16, 2026
More information. I commented out line 694 of the macro because the clear_filter was really not necessary and now I can no longer reproduce the issue. Very strange.
nagisml commentedon Nov 16, 2026
@GeePa67 Thanks for the detailed report. I could reproduce this reliably on 1.23.0-beta.5, and your finding about line 694 was the key clue.
As this is a race condition bug, there is no 100% certainty, but maybe you can confirm the below and later the fix in the next beta.
Cause
It's a race between
opensak.clear_filter()andopensak.filter{}:clear_filter()starts loading the whole, unfiltered list in the background.opensak.filter{}fills the grid right away with the correct result. That's why the count it returns and your HTML are always right.Why it's intermittent
opensak.progresslets the app process pending events while your loop runs. If the background load finishes during the loop, it arrives beforefilter{}and does no harm. If it finishes after the last progress update, it overwrites the filtered list. Loading every cache from a large database takes longer, so the bug shows up much more often there than on a small test copy.Workaround
Until it's fixed, leave out the
opensak.clear_filter()call, as you already found. Your macro reads the caches withopensak.caches{}before that line anyway.Fix
Applying a filter should discard any list load that is still running, so a late result can't overwrite it. I'll prepare a fix with a regression test.
Keep a macro filter from being replaced by an earlier list reload
github-actions commentedon Nov 17, 2026
@GeePa67 This was fixed in PR #1326 and will be included in the next beta release. 🎉