Skip to content

Commit

Permalink
[lib] Add log and continue in getPushUserInfo when thread missing fro…
Browse files Browse the repository at this point in the history
…m ThreadStore

Summary:
This has come up twice now: [ENG-9454](https://linear.app/comm/issue/ENG-9454/cannot-read-properties-of-undefined-when-leaving-thread) and [ENG-9946](https://linear.app/comm/issue/ENG-9946/cannot-read-properties-of-undefined-reading-members).

I think it will help us in the future to have a more specific error message. It also is probably a good idea to `continue;` here, in case there are other notifs that we can send successfully.

Test Plan: Ran the code and confirmed the log was printed

Reviewers: angelika, kamil, tomek

Reviewed By: kamil

Differential Revision: https://phab.comm.dev/D14160
  • Loading branch information
Ashoat committed Dec 18, 2024
1 parent 7c658ac commit 98e1d21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/push/send-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ async function getPushUserInfo(

for (const threadID of threadsToMessageIndices.keys()) {
const threadInfo = thickRawThreadInfos[threadID];
if (!threadInfo) {
console.log(`getPushUserInfo could not find ${threadID} in ThreadStore`);
continue;
}
for (const memberInfo of threadInfo.members) {
if (
!isMemberActive(memberInfo) ||
Expand Down

0 comments on commit 98e1d21

Please sign in to comment.