Skip to content

fix(dynamic): make search_refresh actually refresh virtual folders#87

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/search-refresh-vfolder
Jul 3, 2026
Merged

fix(dynamic): make search_refresh actually refresh virtual folders#87
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/search-refresh-vfolder

Conversation

@ralflang

@ralflang ralflang commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #86.

Clicking the search_refresh icon on the Virtual INBOX (or any virtual folder / search mailbox) animated the spinner briefly but left the message list unchanged.

Two contributing issues, both server-side:

  1. IMP.poll(true) in js/base.js sends forceUpdate=1 at the top level of the Ajax parameters, but IMP_Ajax_Application::changed() only inspected viewport->force. The force flag was silently dropped for every caller that used it, including the viewPort() handler's own sort-preference-change branch on line 84.

  2. Even with force honored, a search mailbox's cacheid is derived from IMP_Search_Query::cacheGeneration(), which only advances when invalidateCache() is called — and nothing on the read-only poll path invalidated it. Deletions worked because IMP_Indices::delete() already calls IMP_Search::invalidateMailboxes().

Changes:

  • lib/Ajax/Application.phpchanged() now accepts forceUpdate at the top level in addition to the pre-existing viewport->force path. Strictly additive.
  • lib/Ajax/Application/Handler/Common.phppoll() gains a guarded pre-step: when a force flag is set and the current mailbox is a search mailbox, invalidate the underlying query's cache and rebuild its mailbox list so changed() sees fresh state and the viewport gets repopulated. Real IMAP folders take exactly the same path they did before.

No JS wire-format change. No PHP signature changes.

@ralflang ralflang merged commit 41374cd into FRAMEWORK_6_0 Jul 3, 2026
1 check failed
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

Successfully merging this pull request may close these issues.

search_refresh not working in virtual INBOX. IMP 7.0.1

1 participant