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
F1666835: D7842.diff
Fri, Apr 26, 11:20 AM
Unknown Object (File)
Wed, Apr 24, 5:26 PM
Unknown Object (File)
Mon, Apr 22, 8:24 AM
Unknown Object (File)
Mon, Apr 22, 8:24 AM
Unknown Object (File)
Mon, Apr 22, 8:24 AM
Unknown Object (File)
Mon, Apr 22, 8:24 AM
Unknown Object (File)
Mon, Apr 22, 8:24 AM
Unknown Object (File)
Mon, Apr 22, 8:21 AM
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.