@bobfrankston/rmfmail 1.1.90 → 1.1.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.commitmsg CHANGED
@@ -1,7 +1,13 @@
1
- Search history records live (no-Enter) searches too
1
+ Fix: viewer showed wrong body (header/body mismatch on search results)
2
2
 
3
- Search history only recorded on Enter, so a search typed and run
4
- live ("Hoddie") never appeared in the history dropdown. Every executed
5
- search is now recorded; recordSearchHistory() prunes any entry that is a
6
- prefix of the new query, collapsing the keystroke progression ("Hod",
7
- "Hodd") into the final term so it lands in history exactly once.
3
+ The viewer's same-message guard keyed on (uid, folderId). uid is only
4
+ unique within a folder, so a cross-folder search could surface two
5
+ different messages with the same uid; when the result's folderId was
6
+ omitted the guard mis-fired it refreshed the header to the clicked
7
+ message but kept the previously-shown message's body in the iframe. The
8
+ viewer looked "scrambled": header said one message, body showed another.
9
+
10
+ The guard now keys on the stable `uuid` whenever both sides have one,
11
+ falling back to (uid, folderId) only for uuid-less envelopes (thread
12
+ popup). The local store/.eml files were never corrupt — this was purely
13
+ a viewer identity-check bug.
@@ -1095,7 +1095,8 @@ async function showMessage(accountId, uid, folderId, specialUse, isRetry = false
1095
1095
  const headerEl = document.getElementById("mv-header");
1096
1096
  const bodyEl = document.getElementById("mv-body");
1097
1097
  const attEl = document.getElementById("mv-attachments");
1098
- if (!isRetry && currentMessage && currentAccountId === accountId && currentMessage.uid === uid && (folderId === void 0 || currentMessage.folderId === folderId) && bodyEl.querySelector("iframe")) {
1098
+ const sameMessage = !!currentMessage && currentAccountId === accountId && (envelope?.uuid && currentMessage.uuid ? envelope.uuid === currentMessage.uuid : currentMessage.uid === uid && (folderId === void 0 || currentMessage.folderId === folderId));
1099
+ if (!isRetry && sameMessage && bodyEl.querySelector("iframe")) {
1099
1100
  if (envelope) {
1100
1101
  lastEnvelope = envelope;
1101
1102
  try {