Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytics - duplicated events in Debug View / Debug build #5858

Closed
leonardosgcit opened this issue Apr 11, 2024 · 13 comments
Closed

Analytics - duplicated events in Debug View / Debug build #5858

leonardosgcit opened this issue Apr 11, 2024 · 13 comments

Comments

@leonardosgcit
Copy link

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Hedgehog | 2023.1.1 Patch 2
  • Firebase Component: Analytics
  • Component version: 32.8.0

[REQUIRED] Step 3: Describe the problem

Some events are duplicated when using the Debug View.
It doesn't seem to happen in a release build.

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

2024-04-01_16-27-21

Adding logs before each "logEvent" call and enabling the FA and FA-SVC logs, I noticed that a single call to "logEvent" caused two "Logging event" messages and the events have the same parameter values:

2024-04-11_08-10-15

Relevant Code:

// TODO(you): code here to reproduce the problem
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@lehcar09
Copy link

Hi @leonardosgcit, thank you for reaching out. I tried reproducing the issue, but I was unable to encounter the behavior. Can you share an MCVE or code snippet to help us investigate the issue? Thanks!

@leonardosgcit
Copy link
Author

leonardosgcit commented Apr 12, 2024

I was unable to reproduce it in a new project but it stopped duplicating the "login_app_success" when I renamed it to "login".
And it started duplicating again when I changed back to "login_app_success".

Taking a look at the logs for the "FA-SVC" tag I found two "events" in the "batch object" right after the log message:

04-01 15:04:17.190 V/FA-SVC (12335): Uploading data. app, uncompressed size, data: <package_name>
04-01 15:04:17.190 V/FA-SVC (12335): batch {
04-01 15:04:17.190 V/FA-SVC (12335): bundle {

Comparing those events, I got two differences:
2024-04-12_11-40-43

@lehcar09
Copy link

Can you share an MCVE with me? Here's how I log the similar event, but seeing just one instance in the debug view.

firebaseAnalytics.logEvent("login_app_success") {
          param("custom_uuid", "test")
      }
Screenshot 2024-04-13 at 1 03 54 AM

@leonardosgcit
Copy link
Author

I can't reproduce it in a MCVE.

But I created another app in the same Firebase project using a different package name and a new product flavor.
I downloaded the new google-service.json file and the duplication stopped for that new package name.
If I build in the old package name, it still happens.
Does it make sense?

@lehcar09
Copy link

Thanks for sharing that. Could you share a code snippet on how you are logging the event? Is there another event that duplicates?

Aside from that, could you try to move the logging of events (i.e another function call)? Another possibility I could think of for this to happen is, if you are creating an event based on an existing event. Per checking, if you have created an event from the console, it also shows up in the verbose log. You could check this documentation for reference.

@leonardosgcit
Copy link
Author

leonardosgcit commented Apr 23, 2024

This method is called everywhere in the app:

override fun sendEvent(eventName: String, params: Bundle?) {
    firebaseAnalytics.logEvent(eventName, params)
}

We only noticed the duplication of the "login_app_success" event so far.

I'll make the other requested tests later.

@leonardosgcit
Copy link
Author

I tried moving the logging event call to other function and the duplication also happens.
Now, I am waiting a response from the data team to verify the event in the console.

@umbrellait-Zafar-Abdulloev

Having a similar issue. Found a discussion in stackoverflow, please check it out.
Multiple events sending in for-loop showing multiple event's property value instead of single property value

@chopfitzroy
Copy link

Seeing this as well when trying to send an event for each item in a cart, so same event sent X number of times with different values.

Instead what I get is X number of events with all the values combined.

@lehcar09
Copy link

Hi @leonardosgcit, just wanted to check if you heard anything from your team about the possiblity that you have event created from console?

@leonardosgcit
Copy link
Author

Hi @lehcar09 , sorry for the delay. We are working on other priority tasks.
I didn't get a response but we decided to live with that issue for now since it only occurs in the debug view.

@lehcar09
Copy link

lehcar09 commented Jun 4, 2024

Hi @leonardosgcit. I understand. Based in my investigation, the _syn parameter is added to events created from Firebase console. That being said. I'll be closing this thread for now. Let me know if we need to re-open the issue for investigation. Thanks!

@lehcar09 lehcar09 closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants