Page MenuHomePhabricator

[lib] fix pinned content for non-media messages
ClosedPublic

Authored by kamil on May 16 2023, 7:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 11:26 AM
Unknown Object (File)
Thu, Nov 14, 11:26 AM
Unknown Object (File)
Thu, Nov 14, 11:26 AM
Unknown Object (File)
Thu, Nov 14, 11:26 AM
Unknown Object (File)
Thu, Nov 14, 11:23 AM
Unknown Object (File)
Thu, Nov 14, 11:00 AM
Unknown Object (File)
Fri, Nov 8, 6:54 AM
Unknown Object (File)
Mon, Nov 4, 1:18 PM
Subscribers

Details

Summary

Context in ENG-3897.

To fix problem adding condition if media_infos is empty array (which should prevent calling translateClientDBMediaInfosToMedia for non-media messages.

Test Plan

Check on physical device and prod backend if error disappeared.

Diff Detail

Repository
rCOMM Comm
Branch
fix-pin
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.May 16 2023, 8:07 AM
atul added inline comments.
lib/utils/message-ops-utils.js
111–112

Hm, so we should also see why an empty media_infos array could have even "gotten" here?

It looks like something like this:

661fe7.png (486×1 px, 126 KB)

would be the right answer.

I would totally put up a diff making that change, but I'd need to do a LOT more testing to make sure that the change won't introduce another set of issues. I think what you have here is the best bet for now.

This revision is now accepted and ready to land.May 16 2023, 8:35 AM
lib/utils/message-ops-utils.js
111–112

Hm, so we should also see why an empty media_infos array could have even "gotten" here?

It looks like something like this:

661fe7.png (486×1 px, 126 KB)

would be the right answer.

Yeah, I tested this previously while investigating and this code you linked is the "source" of those empty arrays.