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
F3405779: D7842.id.diff
Tue, Dec 3, 10:54 PM
F3405777: D7842.diff
Tue, Dec 3, 10:54 PM
Unknown Object (File)
Tue, Nov 26, 8:25 PM
Unknown Object (File)
Tue, Nov 26, 8:21 PM
Unknown Object (File)
Tue, Nov 26, 8:09 PM
Unknown Object (File)
Sat, Nov 23, 4:35 AM
Unknown Object (File)
Sat, Nov 23, 1:25 AM
Unknown Object (File)
Thu, Nov 14, 11:26 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #26546)

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 ↗(On Diff #26546)

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.