Skip to content

Refactor settings storage to Preferences DataStore to remove Protobuf#525

Open
davidjiagoogle wants to merge 2 commits into
mainfrom
david/protobufRemoval
Open

Refactor settings storage to Preferences DataStore to remove Protobuf#525
davidjiagoogle wants to merge 2 commits into
mainfrom
david/protobufRemoval

Conversation

@davidjiagoogle
Copy link
Copy Markdown
Collaborator

This PR refactors settings storage from Proto DataStore to Preferences DataStore. This allows us to completely remove the com.google.protobuf dependency and its generated Java code, saving ~134 KB of bytecode footprint in platform environments where dependencies are linked dynamically.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the application's settings storage from Proto DataStore to Preferences DataStore, removing all Protobuf dependencies, plugins, and schema files. Model enums and DebugSettings have been updated to remove proto conversion methods, with DebugSettings now using a custom string-based serialization format. LocalSettingsRepository has been refactored to read and write settings using Preferences keys. The review feedback highlights critical robustness issues where unsafe string parsing (using valueOf directly on stored preferences or parsing DebugSettings without validation) could lead to runtime crashes (e.g., IllegalArgumentException or NumberFormatException) if the data is corrupted or malformed. Implementing safe parsing helpers with fallback defaults is highly recommended to ensure app stability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant