Page MenuHomePhabricator

[native] Fixed crash when logging out while thread opened
ClosedPublic

Authored by kuba on Feb 8 2023, 6:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 6:53 AM
Unknown Object (File)
Wed, Apr 17, 6:53 AM
Unknown Object (File)
Wed, Apr 17, 6:53 AM
Unknown Object (File)
Wed, Apr 17, 6:52 AM
Unknown Object (File)
Mar 25 2024, 1:55 PM
Unknown Object (File)
Mar 20 2024, 9:04 PM
Unknown Object (File)
Mar 20 2024, 9:04 PM
Unknown Object (File)
Mar 20 2024, 9:04 PM
Subscribers

Details

Summary

Removed invariant, which was causing the error, and modified measureMessages method so that it can handle the case where messages is null.

Test Plan

Checked logging out while there was opened the chat window, now it doesn't throw an error.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The summary can be improved a bit

checked null values in measureMessages method.

This can be replaced by more correct description, e.g.

modified measureMessages method so that it can handle the case where messages is null

native/chat/message-list-container.react.js
93–117 ↗(On Diff #22275)

It seems like it should be possible to just avoid calling measureMessages when messageListData is null. We even have some code to handle !newListData && oldListData case.
On the other hand, measureMessages already supports null threadInfo, so doing the same for messages also makes sense.

So it seems like the current approach is ok.

This revision is now accepted and ready to land.Feb 9 2023, 2:45 AM
kuba edited the test plan for this revision. (Show Details)