Skip to content

refactor(firebase-ai): use explicit backing fields and the new onDeviceExtension#2804

Open
thatfiredev wants to merge 2 commits into
masterfrom
rpf/kotlin-2.4.0
Open

refactor(firebase-ai): use explicit backing fields and the new onDeviceExtension#2804
thatfiredev wants to merge 2 commits into
masterfrom
rpf/kotlin-2.4.0

Conversation

@thatfiredev
Copy link
Copy Markdown
Member

@thatfiredev thatfiredev commented Jun 4, 2026

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 refactors several ViewModels to use Kotlin's explicit backing fields for UI state and message flows, and updates the Kotlin version to 2.4.0. However, the refactoring introduces critical compilation errors across multiple files (including HybridInferenceViewModel, ChatViewModel, ServerPromptTemplateViewModel, and SvgViewModel). In Kotlin, explicit backing fields are only accessible within the property's own accessors and cannot be mutated or accessed from other member functions. Since these properties are exposed as read-only StateFlow types, attempting to update them or set their values from other methods will fail to compile. It is recommended to revert to the traditional private _uiState / public uiState pattern.

@thatfiredev
Copy link
Copy Markdown
Member Author

Ignoring the Gemini reviews because the code compiles successfully

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