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)
Mon, Sep 23, 2:41 PM
Unknown Object (File)
Fri, Sep 20, 1:47 AM
Unknown Object (File)
Fri, Sep 20, 1:47 AM
Unknown Object (File)
Fri, Sep 20, 1:47 AM
Unknown Object (File)
Thu, Sep 19, 10:07 PM
Unknown Object (File)
Thu, Sep 19, 9:06 PM
Unknown Object (File)
Thu, Sep 19, 8:48 PM
Unknown Object (File)
Thu, Sep 19, 8:37 PM

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
Branch
landmay31 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

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