fix(dynamic): make search_refresh actually refresh virtual folders#87
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #86.
Clicking the
search_refreshicon 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:
IMP.poll(true)injs/base.jssendsforceUpdate=1at the top level of the Ajax parameters, butIMP_Ajax_Application::changed()only inspectedviewport->force. The force flag was silently dropped for every caller that used it, including theviewPort()handler's own sort-preference-change branch on line 84.Even with force honored, a search mailbox's cacheid is derived from
IMP_Search_Query::cacheGeneration(), which only advances wheninvalidateCache()is called — and nothing on the read-only poll path invalidated it. Deletions worked becauseIMP_Indices::delete()already callsIMP_Search::invalidateMailboxes().Changes:
lib/Ajax/Application.php—changed()now acceptsforceUpdateat the top level in addition to the pre-existingviewport->forcepath. Strictly additive.lib/Ajax/Application/Handler/Common.php—poll()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 sochanged()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.