feat(proto): add backup and restore for proto preference#171
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces byte-array backup and restore capabilities (exportAsByteArray and importFromByteArray) to ProtoDatastore and GenericProtoDatastore, allowing factory-created datastores to export and import raw bytes. It includes multiplatform tests across Android, iOS, and Desktop, and integrates FileKit into the sample Compose applications to demonstrate the export and restore UI. The review feedback highlights a potential concurrency and file-locking issue on Windows/Desktop when reading the datastore file directly from the file system during backup. It suggests a safer, fully synchronized, in-memory serialization approach using the existing OkioSerializer instead of direct file system access.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini summary |
Summary of ChangesThis pull request introduces robust backup and restore capabilities for ProtoDatastore, enabling users to export and import the datastore state as a byte array. By capturing the necessary serializer and file path information during datastore creation, the implementation provides a seamless way to persist or migrate data. The changes include new core APIs, specialized backup/restore utilities, extensive cross-platform testing, and a practical UI implementation in the sample application. Highlights
Activity
|
New Pull Request
Pull Request Type
Related issue
Description
Added a way to perform backup and restore by exporting the current proto datastore's file
Screenshots
Testing
Additional context