-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feature: Change path of the resources cache db (CP #13707) #13947
Conversation
51dfa45
to
e5fa928
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mbgl::Core
part looks good in general, minor comment. We need unit tests for this.
void OfflineDatabase::changePath(const std::string& path_) { | ||
Log::Info(Event::Database, "Changing the database path."); | ||
|
||
statements.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we call on the destructor. This functions might throw and we should catch. To avoid duplicating the code, make both the destructor and this function call something like OfflineDatabase::cleanup
fa9701e
to
82d4aab
Compare
82d4aab
to
734b217
Compare
Ready for another round. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from the core
side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some kind of instrumented unit test to this?
Have we tested updating the cachepath when a mapview is in use or while offlinedownload is ongoing?
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/storage/FileSource.java
Show resolved
Hide resolved
.../main/java/com/mapbox/mapboxsdk/testapp/activity/offline/ChangeResourcesCachePathActivity.kt
Outdated
Show resolved
Hide resolved
.../main/java/com/mapbox/mapboxsdk/testapp/activity/offline/ChangeResourcesCachePathActivity.kt
Outdated
Show resolved
Hide resolved
The idea is that https://github.com/mapbox/mapbox-gl-native/pull/13947/files#diff-bfa4af72183147adf9f916e65d5e64c3R278 guards against those, do you see a better way? |
…of the whole FileSource
734b217
to
c39782b
Compare
Thank you for the refactoring and merging @LukasPaczos ! Unfortunately I found a bug: #14297 |
CPs #13707 and changes the reinitialization flow to reset the database instead of the whole
FileSource
.Again, thanks a lot for the contribution @arnekaiser!