HomePhabricator
Diffusion Comm dbb75162174c

[native] Remove length check when unpickling

Description

[native] Remove length check when unpickling

Summary:
When we upgraded Olm versions, the length of ::olm_pickle_account_length(this->account) decreased because PICKLE_VERSION got updated. In other words, the Olm team changed the serialization format.

As a result of this, we started seeing exceptions anytime initializeCryptoAccount was called.

Looking at Olm code, the purpose of ::olm_pickle_account_length and ::olm_pickle_session_length is to figure out how much space to allocate to a buffer for pickling. It will always give you the size necessary for the most recent PICKLE_VERSION. It should not be used to compare the size in the database, since that could correspond to an old PICKLE_VERSION.

Test Plan: I was able to repro the issue, and able to confirm that this fix resolved the issue

Reviewers: atul

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D7084

Details

Provenance
ashoatAuthored on Mar 16 2023, 12:45 PM
Reviewer
atul
Differential Revision
D7084: [native] Remove length check when unpickling
Parents
rCOMMccb5daf8d543: Bump activesupport from 6.1.7.1 to 6.1.7.3 in /native
Branches
Unknown
Tags
Unknown