[ECO-5606] fix: enforce Locale.ROOT for string formatting in StreamsChannel#581
[ECO-5606] fix: enforce Locale.ROOT for string formatting in StreamsChannel#581
Locale.ROOT for string formatting in StreamsChannel#581Conversation
WalkthroughReplaced locale-sensitive String.format calls in StreamsChannel.java to explicitly use Locale.ROOT and removed an unused SuppressLint import/annotation. Updated CI iOS integration: removed device-matrix strategy and bumped the Flutter version from 3.24 to 3.29. Changes
Sequence Diagram(s)sequenceDiagram
participant Android as Android (system locale)
participant Streams as StreamsChannel
participant Flutter as Flutter EventSink
Android->>Streams: emit event name/payload (may contain locale-specific digits)
rect rgb(235,245,255)
Note right of Streams: Formatting now uses Locale.ROOT (explicit)
end
Streams->>Streams: String.format(Locale.ROOT, ...)
Streams->>Flutter: deliver formatted event via EventSink
Flutter->>Flutter: listeners receive callbacks
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (1)
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 |
307ecf0 to
78f2465
Compare
78f2465 to
d8d86af
Compare
d8d86af to
45ad9ee
Compare
- Updated `String.format` calls to use `Locale.ROOT` to ensure consistent formatting regardless of device locale configuration. - Removed unnecessary `@SuppressLint` annotation.
45ad9ee to
45412f8
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes locale-dependent string formatting in the StreamsChannel class to ensure consistent behavior across different device configurations. The change enforces Locale.ROOT for all String.format calls, preventing potential issues where formatting could vary based on the user's device locale settings.
Key Changes:
- Updated two
String.formatcalls inStreamsChannel.javato explicitly useLocale.ROOT - Removed unnecessary
@SuppressLint("DefaultLocale")annotation now that locale is explicitly specified - Updated CI configuration to use Flutter 3.29
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
android/src/main/java/io/ably/flutter/plugin/StreamsChannel.java |
Added Locale.ROOT parameter to String.format calls and removed suppresslint annotation |
.github/workflows/flutter_integration.yaml |
Updated Flutter version to 3.29 and removed device matrix strategy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Resolves #580
String.formatcalls to useLocale.ROOTto ensure consistent formatting regardless of device locale configuration.@SuppressLintannotation.Summary by CodeRabbit
Bug Fixes
Chores