-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUM-5084 feat: add ability to clear data in feature data storage #1940
Conversation
@@ -31,6 +31,7 @@ internal struct CoreDirectory { | |||
/// - Returns: The Feature's directories | |||
func getFeatureDirectories(forFeatureNamed name: String) throws -> FeatureDirectories { | |||
return FeatureDirectories( | |||
root: try coreDirectory.createSubdirectory(path: "\(name)"), |
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.
question/ The root
doesn't seem to be used in production code. Is it necessary?
I only see root
being used in tests (to access DS directory), which introduces large inconsistency:
- the real path to feature DS is created here;
- and here, the
root
targets exactly the same path without keeping both in sync.
We may benefit from having dataStorePath
defined in FeatureDirectories
and used by FeatureDataStore
. This will centralize the DS path management and solve the inconsistency. WDYT @ganeshnj ?
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.
On a high level it makes sense but current getFeatureDirectories
API is throws which makes it harder to integrate with existing system.
However, I made some changes and introduced a new API which is similar that returns the path of the data store which can be used to create dir later on. This also aligns perfectly with the approach we took where data store dir is created on demand.
2885733
to
d69be39
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.
🎯
3eed11d
to
6f1b3c6
Compare
What and why?
We have
clearAllData
today which clears the events but doesn't clear the feature data storage that we use for persisting data for feature likes app hangs, watchdog terminations etc.How?
Introduce new API to clear data in the feature data storage.
Review checklist
Custom CI job configuration (optional)