RUMM-2204: Data is written in the SDK specific location #975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This change brings support of dedicated storage folders for multiple SDK instances. Now each
SdkCore
instance will get a unique ID, which issha256(token+site)
, and this ID will be used to create a root folder where this particular instance is going to store features data. Now, the folder structure will be like the following:In the example above we have 2 instances of
SdkCore
running with IDsb0f6d4ccffaa
anda4b6c1d4eebb
.CoreFeature
now ownsstorageDir
which will be the root for all the storage of the particular SDK instance. By referencing it from the persistence layer it is possible to removeContext
references from many places.SDK is still going to store files in the cache folder, in that sense nothing changed.
This change also cherry-picks f1890e1 to remove unused endpoints (in order to avoid adding unnecessary code) and removes file location migration (from files dir to cache dir), because anyway new file format for batches is not compatible with old SDK.
Similar to DataDog/dd-sdk-ios#906.
NB: If SHA-256 doesn't exist on the device there is no fallback, we don't proceed with SDK initialization. I think this is fine, because "this should never happen" (c) (unlikely that some OEMs is going to strip out such basic things from the OS build).
Review checklist (to be filled by reviewers)