Skip to content

Commit

Permalink
Merge branch 'main' into feat/vector-query
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyokone committed Nov 7, 2024
2 parents e9a3202 + 17dfff1 commit 2d7a246
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e_tests_fdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand All @@ -48,7 +48,7 @@ jobs:
channel: 'stable'
cache: true
- name: Setup PostgreSQL for Linux/macOS/Windows
uses: ikalnytskyi/action-setup-postgres@v6
uses: ikalnytskyi/action-setup-postgres@v7
- uses: bluefireteam/melos-action@c7dcb921b23cc520cace360b95d02b37bf09cdaa
with:
run-bootstrap: false
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand All @@ -105,7 +105,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Setup PostgreSQL for Linux/macOS/Windows
uses: ikalnytskyi/action-setup-postgres@v6
uses: ikalnytskyi/action-setup-postgres@v7
- uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92
name: Xcode Compile Cache
with:
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand All @@ -185,7 +185,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Setup PostgreSQL for Linux/macOS/Windows
uses: ikalnytskyi/action-setup-postgres@v6
uses: ikalnytskyi/action-setup-postgres@v7
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: SARIF file
path: results.sarif
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: '20'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: "20"
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
name: Install Node.js 20
with:
node-version: "20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ private FirebaseFirestore readFirestoreInstance(ByteBuffer buffer) {
String databaseURL = (String) readValue(buffer);
FirebaseFirestoreSettings settings = (FirebaseFirestoreSettings) readValue(buffer);
synchronized (FlutterFirebaseFirestorePlugin.firestoreInstanceCache) {
if (FlutterFirebaseFirestorePlugin.getFirestoreInstanceByNameAndDatabaseUrl(
appName, databaseURL)
!= null) {
return FlutterFirebaseFirestorePlugin.getFirestoreInstanceByNameAndDatabaseUrl(
appName, databaseURL);
FirebaseFirestore cachedFirestoreInstance =
FlutterFirebaseFirestorePlugin.getFirestoreInstanceByNameAndDatabaseUrl(
appName, databaseURL);
if (cachedFirestoreInstance != null) {
return cachedFirestoreInstance;
}

FirebaseApp app = FirebaseApp.getInstance(appName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ static FirebaseFirestoreSettings getSettingsFromPigeon(
public static FirebaseFirestore getFirestoreFromPigeon(
GeneratedAndroidFirebaseFirestore.FirestorePigeonFirebaseApp pigeonApp) {
synchronized (FlutterFirebaseFirestorePlugin.firestoreInstanceCache) {
if (FlutterFirebaseFirestorePlugin.getFirestoreInstanceByNameAndDatabaseUrl(
pigeonApp.getAppName(), pigeonApp.getDatabaseURL())
!= null) {
return FlutterFirebaseFirestorePlugin.getFirestoreInstanceByNameAndDatabaseUrl(
pigeonApp.getAppName(), pigeonApp.getDatabaseURL());
FirebaseFirestore cachedFirestoreInstance =
FlutterFirebaseFirestorePlugin.getFirestoreInstanceByNameAndDatabaseUrl(
pigeonApp.getAppName(), pigeonApp.getDatabaseURL());
if (cachedFirestoreInstance != null) {
return cachedFirestoreInstance;
}

FirebaseApp app = FirebaseApp.getInstance(pigeonApp.getAppName());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://firebase.google.com/support/release-notes/ios
def firebase_sdk_version!()
'11.2.0'
'11.4.0'
end
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ class Query<T extends database_interop.QueryJsImpl> extends JsObjectWrapper<T> {
streamController = StreamController<QueryEvent>.broadcast(
onListen: startListen,
onCancel: stopListen,
sync: true,
);
return streamController.stream;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ @implementation FLTFirebaseMessagingPlugin {
NSObject<FlutterPluginRegistrar> *_registrar;
NSData *_apnsToken;
NSDictionary *_initialNotification;
bool simulatorToken;

// Used to track if everything as been initialized before answering
// to the initialNotification request
Expand Down Expand Up @@ -57,7 +56,6 @@ - (instancetype)initWithFlutterMethodChannel:(FlutterMethodChannel *)channel
_initialNotificationGathered = NO;
_channel = channel;
_registrar = registrar;
simulatorToken = false;
// Application
// Dart -> `getInitialNotification`
// ObjC -> Initialize other delegates & observers
Expand Down Expand Up @@ -1005,29 +1003,12 @@ + (NSDictionary *)remoteMessageUserInfoToDict:(NSDictionary *)userInfo {
- (void)ensureAPNSTokenSetting {
FIRMessaging *messaging = [FIRMessaging messaging];

// With iOS SDK >= 10.4, an APNS token is required for getting/deleting token. We set a dummy
// token for the simulator for test environments. Historically, a simulator will not work for
// messaging. It will work if environment: iOS 16, running on macOS 13+ & silicon chip. We check
// the `_apnsToken` is nil. If it is, then the environment does not support and we set dummy
// token.
#if TARGET_IPHONE_SIMULATOR
if (simulatorToken == false && _apnsToken == nil) {
NSString *str = @"fake-apns-token-for-simulator";
NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
[[FIRMessaging messaging] setAPNSToken:data type:FIRMessagingAPNSTokenTypeSandbox];
}
// We set this either way. We set dummy token once as `_apnsToken` could be nil next time
// which could possibly set dummy token unnecessarily
simulatorToken = true;
#endif

if (messaging.APNSToken == nil && _apnsToken != nil) {
#ifdef DEBUG
[[FIRMessaging messaging] setAPNSToken:_apnsToken type:FIRMessagingAPNSTokenTypeSandbox];
#else
[[FIRMessaging messaging] setAPNSToken:_apnsToken type:FIRMessagingAPNSTokenTypeProd];
#endif

_apnsToken = nil;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ private void tearDownChannel() {
channel = null;
eventChannel.setStreamHandler(null);
eventChannel = null;
for (ConfigUpdateListenerRegistration listener : listenersMap.values()) {
listener.remove();
listenersMap.remove(listener);
}
removeEventListeners();
}

private FirebaseRemoteConfig getRemoteConfig(Map<String, Object> arguments) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,17 @@ class MethodChannelFirebaseRemoteConfig extends FirebaseRemoteConfigPlatform {
static const EventChannel _eventChannelConfigUpdated =
EventChannel('plugins.flutter.io/firebase_remote_config_updated');

Stream<RemoteConfigUpdate>? _onConfigUpdatedStream;

@override
Stream<RemoteConfigUpdate> get onConfigUpdated {
return _eventChannelConfigUpdated.receiveBroadcastStream(<String, dynamic>{
_onConfigUpdatedStream ??=
_eventChannelConfigUpdated.receiveBroadcastStream(<String, dynamic>{
'appName': app.name,
}).map((event) {
final updatedKeys = Set<String>.from(event);
return RemoteConfigUpdate(updatedKeys);
});
return _onConfigUpdatedStream!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ final class ServiceApiNotEnabled implements VertexAIException {
'The Vertex AI in Firebase SDK requires the Vertex AI in Firebase API '
'(`firebasevertexai.googleapis.com`) to be enabled in your Firebase project. Enable this API '
'by visiting the Firebase Console at '
'https://console.firebase.google.com/$_projectId/genai '
'https://console.firebase.google.com/project/$_id/genai '
'and clicking "Get started". If you enabled this API recently, wait a few minutes for the '
'action to propagate to our systems and then retry.';

@override
String toString() => message;

String get _id {
return _projectId.replaceAll('projects/', '');
}
}

/// Exception thrown when the quota is exceeded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:tests/firebase_options.dart';

// ignore: do_not_use_environment
const bool skipTestsOnCI = bool.fromEnvironment('CI');

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

Expand Down Expand Up @@ -40,6 +43,7 @@ void main() {
expect(result, isA<int?>());
}
},
skip: skipTestsOnCI && defaultTargetPlatform == TargetPlatform.iOS,
);

test('isSupported', () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ void main() {
skip: defaultTargetPlatform != TargetPlatform.android,
);

test(
'resolves dummy APNS token on ios if using simulator',
() async {
expect(await messaging.getAPNSToken(), isA<String>());
},
skip: defaultTargetPlatform != TargetPlatform.iOS,
);
});

group('getInitialMessage', () {
Expand Down Expand Up @@ -178,9 +171,8 @@ void main() {
},
// macOS skipped because it needs keychain sharing entitlement. See: https://github.com/firebase/flutterfire/issues/9538
// android skipped due to consistently failing, works locally: https://github.com/firebase/flutterfire/pull/11260
skip: kIsWeb ||
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.android,
// iOS fails because APNS token handler doesn't have a chance to receive token before calling this method
skip: kIsWeb || skipTestsOnCI,
);
});

Expand All @@ -193,9 +185,8 @@ void main() {
},
// macOS skipped because it needs keychain sharing entitlement. See: https://github.com/firebase/flutterfire/issues/9538
// android skipped due to consistently failing, works locally: https://github.com/firebase/flutterfire/pull/11260
skip: kIsWeb ||
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.android,
// iOS fails because APNS token handler doesn't have a chance to receive token before calling this method
skip: kIsWeb || skipTestsOnCI,
);
});

Expand Down

0 comments on commit 2d7a246

Please sign in to comment.