Closed Bug 1695274 Opened 4 years ago Closed 4 years ago

Port bug 1691913: Rename nsBaseHashtable::Put to InsertOrUpdate

Categories

(Thunderbird :: Upstream Synchronization, defect)

defect

Tracking

(thunderbird_esr78 unaffected, thunderbird87 unaffected)

RESOLVED FIXED
88 Branch
Tracking Status
thunderbird_esr78 --- unaffected
thunderbird87 --- unaffected

People

(Reporter: Paenglab, Assigned: Paenglab)

References

Details

Attachments

(3 files, 3 obsolete files)

No description provided.

Simple exchanges. This builds for me.

Assignee: nobody → richard.marti
Status: NEW → ASSIGNED
Attachment #9205745 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9205745 [details] [diff] [review] 1695274-rename-put-to InsertOrUpdate.patch Review of attachment 9205745 [details] [diff] [review]: ----------------------------------------------------------------- I'm stealing this review since I tested it and it unbusts the build.
Attachment #9205745 - Flags: review?(mkmelin+mozilla) → review+

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/3a6e2573838c
Port bug 1691913: Rename nsBaseHashtable::Put to InsertOrUpdate. r=aleca,rjl

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

This didn't work entirely, there are other things that need porting.
I'll give it a try.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
See Also: → 1691913
Target Milestone: --- → 88 Branch
Attached patch 1695274-bustage-fix.diff (obsolete) — Splinter Review
Attachment #9205760 - Flags: review?(mkmelin+mozilla)

Comment on attachment 9205760 [details] [diff] [review]
1695274-bustage-fix.diff

empty patch, sorry.

Attachment #9205760 - Flags: review?(mkmelin+mozilla)
Attachment #9205761 - Flags: review?(mkmelin+mozilla)
Attachment #9205760 - Attachment is obsolete: true
Comment on attachment 9205761 [details] [diff] [review] 1695274-bustage-fix.diff Review of attachment 9205761 [details] [diff] [review]: ----------------------------------------------------------------- LGTM, r=mkmelin
Attachment #9205761 - Flags: review?(mkmelin+mozilla) → review+

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/c9b0b24eb44e
Port bug 1691913: Rename nsBaseHashtable::Put to InsertOrUpdate. r=mkmelin

Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Attached patch bug1695274_bustage_part3.patch (obsolete) — Splinter Review
Comment on attachment 9205804 [details] [diff] [review] bug1695274_bustage_part3.patch Review of attachment 9205804 [details] [diff] [review]: ----------------------------------------------------------------- This doesn't quite work.. See the test fails at https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=c46b4ba2e8c5d8dcbbe3c26add7c00f3d5777abd ::: mailnews/imap/src/nsImapMailFolder.cpp @@ +2855,2 @@ > newMsgHdr->GetMessageId(getter_Copies(newMessageId)); > + nsMsgKey pseudoKey = m_pseudoHdrs.Get(newMessageId); I'm pretty sure this is where I went wrong -- It looks like .Get will return false when the key is not found, so maybe that's what needs to be checked for instead of nsMsgKey_None? @@ +5858,5 @@ > // in the acl response. > server->GetRealUsername(userName); > } > ToLowerCase(userName); > + rights = m_rightsHash.Get(userName); also not sure if this is okay? &rights is passed into the function by the caller.
Attachment #9205804 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9205804 [details] [diff] [review] bug1695274_bustage_part3.patch Review of attachment 9205804 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/imap/src/nsImapMailFolder.cpp @@ +2855,2 @@ > newMsgHdr->GetMessageId(getter_Copies(newMessageId)); > + nsMsgKey pseudoKey = m_pseudoHdrs.Get(newMessageId); Maybe adding this here it'll do the trick? ``` if (!pseudoKey) { pseudoKey = nsMsgKey_None; } ``` I don't know if it's possible to do a short-circuit evaluation in C++ to assign that variable. @@ +5858,5 @@ > // in the acl response. > server->GetRealUsername(userName); > } > ToLowerCase(userName); > + rights = m_rightsHash.Get(userName); This should be correct because the rights variable is a reference, so updating it will correctly pass the new value to the parent method.
Attached patch bug1695274_bustage_part3.patch (obsolete) — Splinter Review

This should fix it and the broken test.

Attachment #9205804 - Attachment is obsolete: true
Attachment #9205804 - Flags: review?(mkmelin+mozilla)
Attachment #9205814 - Flags: review?(alessandro)
Comment on attachment 9205814 [details] [diff] [review] bug1695274_bustage_part3.patch Review of attachment 9205814 [details] [diff] [review]: ----------------------------------------------------------------- This works locally.
Attachment #9205814 - Flags: review?(alessandro) → review+

This isn't right. You need to use something like:
https://hg.mozilla.org/integration/autoland/rev/cf2c619858c1#l11.30

So instead of

-    nsMsgKey pseudoKey = nsMsgKey_None;
     newMsgHdr->GetMessageId(getter_Copies(newMessageId));
-    m_pseudoHdrs.Get(newMessageId, &pseudoKey);
-    if (notifier && pseudoKey != nsMsgKey_None) {
+    nsMsgKey pseudoKey = m_pseudoHdrs.Get(newMessageId);
+    if (notifier && pseudoKey) {

Add this:

+  nsMsgKey pseudoKey = m_pseudoHdrs.MaybeGet(newMessageId).valueOr(nsMsgKey_None);

and leave if (notifier && pseudoKey != nsMsgKey_None) {.

Attachment #9205814 - Attachment is obsolete: true
Attachment #9205833 - Flags: review?(mkmelin+mozilla)
Attachment #9205833 - Flags: review?(mkmelin+mozilla) → review+
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/1283451c0292 followup - clang-format. rs=clang-format
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: