HomePhabricator
Diffusion Comm 1844ef5fc209

[sqlite] Fix corrupted creation_time timestamps in threads

Description

[sqlite] Fix corrupted creation_time timestamps in threads

Summary:
https://linear.app/comm/issue/ENG-9955/threadstore-timestamp-corruption-issue

I guess this line was supposed to insert the current time, but it doesn't work. It turns out time is a function
(https://en.cppreference.com/w/c/chrono/time) so it reinterpret_casts a pointer to the time function as a
creation date. So that's why I was seeing weird timestamps like 6637613460 and often the same for each thread.

Test Plan:
The most sure way to reproduce the bug (works 100% of the time):
Create a new account (but maybe you don't have to do this)
Restart the app (so we save to sqlite db and read from it again)
See the threads creation dates in the store. Before the fix they were corrupted, after the fix they're ok.

Reviewers: kamil, tomek

Reviewed By: tomek

Subscribers: ashoat

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

Details

Provenance
angelikaAuthored on Tue, Dec 17, 5:19 PM
Reviewer
tomek
Differential Revision
D14168: [sqlite] Fix corrupted creation_time timestamps in threads
Parents
rCOMMefd40b9457f6: [identity] Verify new flow migration device list update
Branches
Unknown
Tags
Unknown