logs: update api response error logs#7
Conversation
📝 WalkthroughWalkthroughThe ChangesConfig emission and logging updates
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/remote/fskin_remote_config.dart (1)
49-54: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winGuard the stream update on a successful theme fetch
fetchConfig()still emitsThemeData(colorScheme: _cachedConfig?.skin?.colors)whenfetchData()returnsnullor the payload has no colors. That can push the default theme to every listener and drop the last known custom theme; only add to_skinControllerwhen a validcolorSchemeis present.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/remote/fskin_remote_config.dart` around lines 49 - 54, Guard the stream update in fetchConfig() so _skinController is only updated after SkinService().fetchData(apiKey) returns a valid config with a non-null colorScheme. If _cachedConfig or _cachedConfig?.skin?.colors is missing, skip calling _skinController.add to avoid broadcasting a fallback ThemeData and overwriting the last custom theme.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@lib/remote/fskin_remote_config.dart`:
- Around line 49-54: Guard the stream update in fetchConfig() so _skinController
is only updated after SkinService().fetchData(apiKey) returns a valid config
with a non-null colorScheme. If _cachedConfig or _cachedConfig?.skin?.colors is
missing, skip calling _skinController.add to avoid broadcasting a fallback
ThemeData and overwriting the last custom theme.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 12840f8b-b19e-4175-a943-a3b42a909dda
📒 Files selected for processing (2)
lib/remote/fskin_remote_config.dartlib/services/skin_service.dart
Summary by CodeRabbit