Repository: firebase/firebase-ios-sdk (language: cpp)

Issue:
Re-enable Functions Combine tests
Disabled in #8258.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml
index 5715a4804d4..e066ddbee22 100644
--- a/.github/workflows/functions.yml
+++ b/.github/workflows/functions.yml
@@ -46,8 +46,8 @@ jobs:
       run: scripts/setup_spm_tests.sh
     - name: iOS Unit Tests
       run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFunctions iOS spmbuildonly
-    # - name: Combine Unit Tests
-    #   run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
+    - name: Combine Unit Tests
+      run: scripts/third_party/travis/retry.sh ./scripts/build.sh FunctionsCombineUnit iOS spm
 
   spm-cron:
     # Don't run on private repo.
diff --git a/Functions/CHANGELOG.md b/Functions/CHANGELOG.md
index 215bb68085b..c0c91f52aea 100644
--- a/Functions/CHANGELOG.md
+++ b/Functions/CHANGELOG.md
@@ -1,3 +1,6 @@
+# v8.3.0
+- [fixed] Fixed an issue where subclassing Functions was unusable (#8265).
+
 # v8.2.0
 - [fixed] Fixed an issue where factory class methods returned a new instance on every invocation, causing emulator settings to not persist between invocations (#7783).
 
diff --git a/Functions/FirebaseFunctions/FIRFunctions.m b/Functions/FirebaseFunctions/FIRFunctions.m
index e8d7800e50a..96e6014f593 100644
--- a/Functions/FirebaseFunctions/FIRFunctions.m
+++ b/Functions/FirebaseFunctions/FIRFunctions.m
@@ -103,7 +103,7 @@ + (instancetype)functionsForApp:(FIRApp *)app
                          region:(NSString *)region
                    customDomain:(nullable NSString *)customDomain {
   id<FIRFunctionsProvider> provider = FIR_COMPONENT(FIRFunctionsProvider, app.container);
-  return [provider functionsForApp:app region:region customDomain:customDomain];
+  return [provider functionsForApp:app region:region customDomain:customDomain type:[self class]];
 }
 
 - (instancetype)initWithApp:(FIRApp *)app
diff --git a/Functions/FirebaseFunctions/FIRFunctionsComponent.h b/Functions/FirebaseFunctions/FIRFunctionsComponent.h
index df48ff619a5..1791b043ae6 100644
--- a/Functions/FirebaseFunctions/FIRFunctionsComponent.h
+++ b/Functions/FirebaseFunctions/FIRFunctionsComponent.h
@@ -24,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (FIRFunctions *)functionsForApp:(FIRApp *)app
                            region:(nullable NSString *)region
-                     customDomain:(nullable NSString *)customDomain;
+                     customDomain:(nullable NSString *)customDomain
+                             type:(Class)cls;
 
 @end
 
diff --git a/Functions/FirebaseFunctions/FIRFunctionsComponent.m b/Functions/FirebaseFunctions/FIRFunctionsComponent.m
index cb86a40328f..6d6204bc30f 100644
--- a/Functions/FirebaseFunctions/FIRFunctionsComponent.m
+++ b/Functions/FirebaseFunctions/FIRFunctionsComponent.m
@@ -92,7 +92,8 @@ - (void)appWillBeDeleted:(FIRApp *)app {
 
 - (FIRFunctions *)functionsForApp:(FIRApp *)app
                            region:(NSString *)region
-                     customDomain:(NSString *_Nullable)customDomain {
+                     customDomain:(NSString *_Nullable)customDomain
+                             type:(Class)cls {
   os_unfair_lock_lock(&_instancesLock);
   NSArray<FIRFunctions *> *associatedInstances = [self instances][app.name];
   if (associatedInstances.count > 0) {
@@ -111,9 +112,7 @@ - (FIRFunctions *)functionsForApp:(FIRApp *)app
     }
   }
 
-  FIRFunctions *newInstance = [[FIRFunctions alloc] initWithApp:app
-                                                         region:region
-                                                   customDomain:customDomain];
+  FIRFunctions *newInstance = [[cls alloc] initWithApp:app region:region customDomain:customDomain];
 
   if (self.instances[app.name] == nil) {
     NSMutableArray *array = [NSMutableArray arrayWithObject:newInstance];


Test patch: