Duplicate logEvent & logEvent's parameters value randomly
To investigate, i try to log Firebase event with this :
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
=> https://gist.github.com/ludwigCDSBDX/5d49f8041bc7b335e6adcf35390e0bd6#file-duplicatelogevent-txt
// we use redux-saga
export function* trackScreenFirebase() {
try {
const appVersion = yield select(getAppVersion);
const environment = yield select(getEnvironment);
const appVariables = getAppVariables({ appVersion, environment });
const screenCategories = yield select(getScreenCategories);
const screenProperties = yield select(getScreenProperties);
const search = yield select(getSearch);
const params = { ...appVariables, ...screenCategories, ...screenProperties, ...search };
yield firebase.analytics().logEvent(eventNames.SCREEN, params);
} catch (error) {
Sentry.captureException(error, { level: SentrySeverity.Error });
}
}
ios/Podfile
:# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '8.0'
source...
target 'XXX' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
[...]
pod 'Firebase/Core', '4.2.0'
pod 'Firebase/DynamicLinks', '4.2.0'
pod 'Firebase/Performance', '4.2.0'
pod 'Firebase/Analytics', '4.2.0'
[...]
end
AppDelegate.m
:// N/A
android/build.gradle
: dependencies {
classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
...
resolutionStrategy {
force "com.google.android.gms:play-services-ads:15.0.1"
force "com.google.android.gms:play-services-gcm:15.0.1"
force "com.google.android.gms:play-services-analytics:15.0.1"
force "com.google.android.gms:play-services-location:15.0.1"
force "com.google.android.gms:play-services-base:15.0.1"
force "com.google.android.gms:play-services-maps:15.0.1"
force "com.google.android.gms:play-services-wallet:15.0.1"
force "com.google.firebase:firebase-core:15.0.2"
force "com.google.firebase:firebase-config:15.0.2"
force "com.google.firebase:firebase-auth:15.1.0"
force "com.google.firebase:firebase-database:15.0.1"
force "com.google.firebase:firebase-storage:15.0.2"
force "com.google.firebase:firebase-messaging:15.0.2"
force "com.google.firebase:firebase-crash:15.0.2"
force "com.google.firebase:firebase-perf:15.1.0"
force "com.google.firebase:firebase-ads:15.0.1"
force "com.google.firebase:firebase-firestore:16.0.0"
force "com.google.firebase:firebase-invites:15.0.1"
}
android/app/build.gradle
:apply plugin: "com.google.firebase.firebase-perf"
...
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation 'com.google.firebase:firebase-firestore:16.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-perf:15.1.0'
android/settings.gradle
:include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir,'../node_modules/react-native-firebase/android')
MainApplication.java
:import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.perf.RNFirebasePerformancePackage;
...
protected List<ReactPackage> getPackages() {
Context context = getApplicationContext();
ImagePipelineConfig frescoConfig = ImagePipelineConfig
.newBuilder(context)
.setBitmapMemoryCacheParamsSupplier(new CustomBitmapMemoryCacheParamsSupplier(context))
.build();
MainPackageConfig appConfig = new MainPackageConfig
.Builder()
.setFrescoConfig(frescoConfig)
.build();
return Arrays.asList(
...
new RNFirebasePackage(),
new RNFirebaseMessagingPackage(),
new RNFirebaseAnalyticsPackage(),
new RNFirebasePerformancePackage()
... );
AndroidManifest.xml
:<application>
<!-- Firebase Perf -->
<meta-data android:name="firebase_performance_logcat_enabled" android:value="true" />
<service
android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
</application>
iOS 11.4.1 or Android 8 or Android 9 (API 23 to 29)
Operating System:
macOS High Sierra 10.13.6
Windows 10
Kubuntu
Build Tools:
Xcode 9.4.1 or Android Studio 3.2.1
React Native
version:"react-native": "0.57.7"
React Native Firebase
library version:"react-native-firebase": "4.2.0"
Firebase
module(s) you're using that has the issue:TypeScript
?N/A
ExpoKit
?ExpoKit
N/A
Think react-native-firebase
is great? Please consider supporting the project with any of the below:
React Native Firebase
and Invertase
on TwitterI also have this issue, using React Native 0.55.3 and React Native Firebase 5.1.0.
i think @AlohaIndy have the same issue too =/ https://github.com/invertase/react-native-firebase/issues/1809
We are also seeing this although curiously only in Android at the moment. Previously had been seeing it randomly on iOS as well. React Native 0.57.7 and React Native Firebase 5.2.0.
Hmm interesting, the code in React Native Firebase just directly calls the Native SDKs so my guess would be that this is a Firebase SDK issue (given that it's happening on both platforms and going back to RNFB v4)
Q: Has anyone reported this to support and got a response?
Q: Also what navigator is everyone using? Could this be an issue with a navigator calling your trackScreenFirebase
multiple times?
Android: https://github.com/invertase/react-native-firebase/blob/master/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalytics.java
iOS: https://github.com/invertase/react-native-firebase/blob/master/ios/RNFirebase/analytics/RNFirebaseAnalytics.m
As you can see in each of those we just call the methods directly, no funky code in-between.
Also; @ludwigCDSBDX thanks so much for a properly filled out issue 馃挍
Just reported to Firebase, no response yet. We are using React Native Navigation from Wix.
Just got a message from firebase support:
Upon checking on our records, there's an ongoing issue that affects duplicate logging event on the debug view of the Google Analytics for Firebase. Our engineer is still working on the fix of this issue. However, we don't have yet any details or timeline as to when the fix will be published to production, but please keep an eye out on our release notes or check the DebugView page from time to time for any updates.
@nmsdvid - thanks for getting in touch with support. As this is a confirmed issue on their end; there's nothing we can do for this. 馃檲
I'll go ahead and close this, but feel free to continue the conversation if needed.
@nmsdvid thank you for contacting support, and do you have a record of the firebase support response? ( it's just for my manager :D) .
@Salakar thanks for your time 馃檹 !
@ludwigCDSBDX what record do you need ? screenshot of the mail or ticket reference number?
ha ! if it was possible to see am "issue" and response like github's issue ^^ , but if you received an email. let it go 鉂勶笍
@nmsdvid Thanks for doing that! The way I read that is a bug with the DebugView only and not impacting the underlying analytics numbers, is that also your interpretation? If so, that would be awesome because we're at a place right now where we feel like we can't trust our analytics numbers.
Same problem here. Any news?
@smathson I think this is not restricted to DebugView, upon investigating firebase events we're seeing some weird stuff.
I just checked the android and ios sdk release notes and saw no mention of duplicate events, for what that's worth. Doesn't mean they didn't fix it and not mention it, and may simply mean it wasn't in the SDK and they fixed (or didn't fix it) elsewhere. But no mention in the SDK release notes, at least.
Most helpful comment
Just got a message from firebase support: