Page MenuHomePhabricator

Implement flat-file based message storage initialization
ClosedPublic

Authored by marcin on Jun 29 2022, 2:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 4:39 PM
Unknown Object (File)
Mon, Nov 11, 3:57 PM
Unknown Object (File)
Mon, Nov 11, 1:20 PM
Unknown Object (File)
Mon, Nov 11, 12:07 PM
Unknown Object (File)
Mon, Nov 11, 11:57 AM
Unknown Object (File)
Mon, Nov 11, 11:42 AM
Unknown Object (File)
Mon, Nov 11, 10:40 AM
Unknown Object (File)
Mon, Nov 11, 10:04 AM

Details

Summary

Implements dile and directory initialization for flat-file message storage.

Test Plan

Modify AppDelegate so that on app launch it prints the content of the directory TemporaryMessageStore was initialized with. Ensure that file ending with Unix timestamp is there.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/ios/Comm/TemporalMessageStorage/TemporalMessageStorage.mm
22 ↗(On Diff #13926)

We can invert this condition to reduce indentation. We just need the line return self in two places, which I think is worth it

native/ios/Comm/TemporalMessageStorage/TemporalMessageStorage.mm
22 ↗(On Diff #13926)

You are right. I will do the refactoring.

Introduce files to project.pbxproj

Remove message separator constant

tomek added inline comments.
native/ios/Comm/TemporalMessageStorage/TemporalMessageStorage.mm
7

It is not yet used - it should be defined in a diff that uses it

24

Wondering if we should define @"group.app.comm" in a common place

29–32

Should we check if the operation was successful?

This revision is now accepted and ready to land.Jul 5 2022, 3:33 AM

New implementation of initialization method and its default parameters

native/ios/Comm/TemporalMessageStorage/TemporalMessageStorage.mm
29–32

Current implementation will not attempt any write or read operation if this operation failed (so the directory does not exist). Bu we should check against its failure and log it, since if it happens one day we will need more details.

Rename Temporal to Temporary

Log failure when creating temporary message storage directory

(ignore the iOS build failure, that was my bad... restarted that job)

native/ios/Comm/TemporalMessageStorage/TemporalMessageStorage.mm
24

I think we definitely we need a common place for this constant and we already have a Linear Task for that: https://linear.app/comm/issue/ENG-585/create-common-place-for-constants. I would not block landing this stack on this task, but it is probably a high time someone was assigned this issue.

This revision was landed with ongoing or failed builds.Jul 14 2022, 5:10 AM
This revision was automatically updated to reflect the committed changes.