Skip to content

Commit 720d5cb

Browse files
authored
Merge pull request #581 from ably/fix-locale-problem
[ECO-5606] fix: enforce `Locale.ROOT` for string formatting in `StreamsChannel`
2 parents 53a0c2a + 45412f8 commit 720d5cb

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

.github/workflows/flutter_integration.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ on:
77

88
jobs:
99
ios:
10-
strategy:
11-
matrix:
12-
device: # Device names must be shown in `xcrun simctl list devices`
13-
- 'iPhone 15' # we are not specifying the iOS version as it tends to change
14-
fail-fast: false
1510
runs-on: macos-latest
1611
steps:
1712
- uses: actions/checkout@v4
@@ -22,7 +17,7 @@ jobs:
2217

2318
- uses: subosito/flutter-action@v2
2419
with:
25-
flutter-version: '3.24'
20+
flutter-version: '3.29'
2621
cache: true
2722

2823
# test_integration package depends on ably_flutter, so before we run integration

android/src/main/java/io/ably/flutter/plugin/StreamsChannel.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020

2121
package io.ably.flutter.plugin;
2222

23-
import android.annotation.SuppressLint;
24-
2523
import androidx.annotation.UiThread;
2624

2725
import java.nio.ByteBuffer;
26+
import java.util.Locale;
2827
import java.util.concurrent.ConcurrentHashMap;
2928
import java.util.concurrent.atomic.AtomicBoolean;
3029

@@ -160,7 +159,7 @@ void clearAll() {
160159
}
161160

162161
private void logError(long id, String message, Throwable e) {
163-
Log.e(TAG + name, String.format("%s [id=%d]", message, id), e);
162+
Log.e(TAG + name, String.format(Locale.ROOT, "%s [id=%d]", message, id), e);
164163
}
165164

166165
private final class EventSinkImplementation implements EventChannel.EventSink {
@@ -169,10 +168,9 @@ private final class EventSinkImplementation implements EventChannel.EventSink {
169168
final String name;
170169
final AtomicBoolean hasEnded = new AtomicBoolean(false);
171170

172-
@SuppressLint("DefaultLocale")
173171
private EventSinkImplementation(long id) {
174172
this.id = id;
175-
this.name = String.format("%s#%d", StreamsChannel.this.name, id);
173+
this.name = String.format(Locale.ROOT, "%s#%d", StreamsChannel.this.name, id);
176174
}
177175

178176
@Override

0 commit comments

Comments
 (0)