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)
Mon, Mar 11, 6:18 PM
Unknown Object (File)
Sun, Mar 10, 6:40 PM
Unknown Object (File)
Sun, Mar 10, 8:12 AM
Unknown Object (File)
Mon, Mar 4, 12:33 AM
Unknown Object (File)
Mon, Mar 4, 12:33 AM
Unknown Object (File)
Feb 23 2024, 8:45 PM
Unknown Object (File)
Feb 23 2024, 8:45 PM
Unknown Object (File)
Feb 23 2024, 7:58 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
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.