[lib] Fix rawMessageInfoFromClientDB to exclude id from local text messages
Summary:
- We currently use id as the primary key of the SQLite messages table
- We use the message-utils:messageID function to determine the id we include in the ClientDBMessageInfo. So if we have a message with only a local ID, both the id and local_id will be set to it.
- However, when we try to pull the rawMessageInfo back out of SQLite, we have an extraneous id property that shouldn't have been included.
- In order to leave out the extraneous id property so the object we end up with is identical to the object we started off with: we exclude the id property unless it's different than the local_id.
- After these changes we end with the same rawMessageInfo we started off with.
Added a test that previously failed and now passes to ensure the correct behavior. Will make this change for the other ComposableMessageTypes (aka images)
Test Plan: Our SQLite store and Redux store are no longer different after the SEND_TEXT_MESSAGE_STARTED action
Reviewers: def-au1t, palys-swm, ashoat
Reviewed By: palys-swm, ashoat
Subscribers: ashoat, Adrian, karol-bisztyga, benschac, boristopalov
Differential Revision: https://phabricator.ashoat.com/D2601