This diff changes implementation of getSQliteFilePath method to return new sqlite path defined by App Groups. Previous version of the method is also kept under different name. It also implements migrationfrom old to new path. Migration uses std::rename instead of NSFileManager API since, std::rename documentation explicitly states that file content shall not be altered in the case of failure. NSFileManager probably works similar but I could not find confirmation in its documentation.
Details
Unistall Comm, build app with new code and install it again. Record new path defined by App Groups. Unistall comm, build with previous version of getSQliteFilePath. Check that the path looks like previous versions. Finally build the new code again, install it, check that database is again under app groups path and the app works correctly which means migration was succesfull.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/ios/Comm/AppDelegate.mm | ||
---|---|---|
237 ↗ | (On Diff #12495) | Nit: would it be best to stick with a consistent // comment syntax? |
246–248 ↗ | (On Diff #12495) | This pattern should always be avoided: if (cond1) { if (cond2) { ... } } It can always be simplified to: if (cond1 && cond2) { ... } As a general rule, you should try to keep indentation to a minimum level. |
native/ios/Comm/Tools.mm | ||
---|---|---|
8–33 ↗ | (On Diff #12495) | The logic for determining the url / path is different. Could you share a doc that describes how to access group url / create db path? |
native/ios/Comm/Tools.mm | ||
---|---|---|
8–33 ↗ | (On Diff #12495) | I am not sure what do you mean? I did not change the logic for obtaining db path. This diff just changes the NSFileManager method to obtain directory in which it should be located to get directory for the App Group. |
native/ios/Comm/Tools.mm | ||
---|---|---|
8–33 ↗ | (On Diff #12495) | I was asking if you are sure that this is the proper way to get a path in the app group. It seems fine, but wanted to make sure that what you did is a good practice. |