Page MenuHomePhabricator

[native] Fix `CommCoreModule:createMessageStoreOperations` for REMOVE_ALL_OPERATION
ClosedPublic

Authored by atul on May 31 2022, 1:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 5:55 PM
Unknown Object (File)
Fri, Nov 22, 12:53 PM
Unknown Object (File)
Fri, Nov 22, 12:53 PM
Unknown Object (File)
Fri, Nov 22, 12:53 PM
Unknown Object (File)
Fri, Nov 22, 12:53 PM
Unknown Object (File)
Fri, Nov 22, 12:51 PM
Unknown Object (File)
Oct 26 2024, 7:33 PM
Unknown Object (File)
Oct 25 2024, 12:10 AM

Details

Summary

Before, we were trying to get payload_obj by calling getProperty(rt, "payload").asObject(rt) regardless of the op type.

However, the REMOVE_ALL_OPERATION type doesn't have a payload which results in the call to getProperty(rt, "payload").asObject(rt) crashing the app.

We weren't using the REMOVE_ALL_OPERATION anywhere before, but we are using it in redux migration 31 ("flipping on SQLite messageStore persistence") which is where the issue was surfaced.

Test Plan

Ran redux migration 31 in my local dev environment and everything worked as expected. Set breakpoints in the C++ code to verify that things were as expected all along the way from the call to global.CommCoreModule.processMessageStoreOperationsSync(...).

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul edited the summary of this revision. (Show Details)
atul edited the summary of this revision. (Show Details)
atul requested review of this revision.May 31 2022, 1:27 PM
ashoat added a subscriber: marcin.

@marcinwasowicz is probably a good person to review this because it has to do with C++ code in native

Looks good to me, I'll just accept now

This revision is now accepted and ready to land.May 31 2022, 1:34 PM

@marcinwasowicz is probably a good person to review this because it has to do with C++ code in native

True, I'll keep that in mind for C++ code in native going forward. Will also add @marcinwasowicz to any diffs related to "flipping the switch" since it's blocking his work.

rebase after cherrypicking before landing