[PR #1480] [MERGED] fix(backend): delete cached imap responses for servers that don't support SORT extension #1546

Closed
opened 2026-02-25 21:38:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/1480
Author: @indridieinarsson
Created: 3/24/2025
Status: Merged
Merged: 4/1/2025
Merged by: @kroky

Base: masterHead: pr_fix_cache_bust


📝 Commits (1)

  • 91e1a6f Store imap command to fetch command list, so it can be busted when needed

📊 Changes

2 files changed (+24 additions, -0 deletions)

View changed files

📝 modules/imap/hm-imap-cache.php (+23 -0)
📝 modules/imap/hm-imap.php (+1 -0)

📄 Description

🍰 Pullrequest

See issue in #1479 for how to reproduce the bug.

This appears to be due to the fact that gmail does not support the SORT imap extension. For that case, there is a separate code path taken when checking for new messages, using UID FETCH [...] to check for messages.

When noticing new messages, there is an attempt to remove the relevant commands from the imap cache, but the UID FETCH was not removed. Therefore, the results from the last FETCH commands are retreived from the cache and served up, but the new message isn't in that list, so is missing. If you use cypht for a bit, opening some messages, then in the end, the relevant cache item is purged and the message shows up, but that could take an hour or 2.

This PR tries to set up a store for the particular imap command that is used for fetching the message list, and ensure it is removed from the cache when appropriate.

Issues


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/1480 **Author:** [@indridieinarsson](https://github.com/indridieinarsson) **Created:** 3/24/2025 **Status:** ✅ Merged **Merged:** 4/1/2025 **Merged by:** [@kroky](https://github.com/kroky) **Base:** `master` ← **Head:** `pr_fix_cache_bust` --- ### 📝 Commits (1) - [`91e1a6f`](https://github.com/cypht-org/cypht/commit/91e1a6f61b067989a28390f4909831ad4750f36f) Store imap command to fetch command list, so it can be busted when needed ### 📊 Changes **2 files changed** (+24 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `modules/imap/hm-imap-cache.php` (+23 -0) 📝 `modules/imap/hm-imap.php` (+1 -0) </details> ### 📄 Description ## 🍰 Pullrequest See issue in #1479 for how to reproduce the bug. This appears to be due to the fact that gmail does not support the SORT imap extension. For that case, there is a separate code path taken when checking for new messages, using `UID FETCH [...]` to check for messages. When noticing new messages, there is an attempt to remove the relevant commands from the imap cache, but the `UID FETCH` was not removed. Therefore, the results from the last FETCH commands are retreived from the cache and served up, but the new message isn't in that list, so is missing. If you use cypht for a bit, opening some messages, then in the end, the relevant cache item is purged and the message shows up, but that could take an hour or 2. This PR tries to set up a store for the particular imap command that is used for fetching the message list, and ensure it is removed from the cache when appropriate. ### Issues - fixes #1479 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:38:36 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1546
No description provided.