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, Oct 28, 2:59 AM
Unknown Object (File)
Thu, Oct 24, 7:04 PM
Unknown Object (File)
Wed, Oct 23, 12:24 AM
Unknown Object (File)
Mon, Oct 21, 7:01 AM
Unknown Object (File)
Sun, Oct 20, 10:04 PM
Unknown Object (File)
Sun, Oct 20, 8:12 AM
Unknown Object (File)
Sat, Oct 19, 11:13 PM
Unknown Object (File)
Sat, Oct 19, 11:10 PM

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 ↗(On Diff #14068)

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

24 ↗(On Diff #14068)

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

29–32 ↗(On Diff #14068)

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 ↗(On Diff #14068)

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 ↗(On Diff #14068)

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.