microsoft / appcenter

Central repository for App Center open source resources and planning.
https://appcenter.ms
Creative Commons Attribution 4.0 International
1.01k stars 225 forks source link

MSCrashes.generateTestCrash() seems to track previous event more than once #531

Open mylemans opened 5 years ago

mylemans commented 5 years ago

What App Center service does this affect? Analytics, maybe Crashes

Describe the bug When tracking an event right before MSCrashes.generateTestCrash() the event gets tracked twice when the app is restarted, while I can confirm the trackEvent function has only been called once.

To Reproduce Steps to reproduce the behavior: (for us)

  1. Run the (macOS) app standalone, no debugger attached
  2. Track an event with some custom properties
  3. Right after, cause a test crash MSCrashes.generateTestCrash()
  4. Restart the app
  5. Check the event flow, you should notice the event got tracked twice

Expected behavior Tracked events in the event flow should match the trackEvent call count at all times.

Screenshots Not a screenshot but a event flow snippet (redacted):

0fffffff EVENT - User_SignedIn - {"method":"Automatic"} 09:08:34 0fffffff EVENT - Trace - {"message":"Generating test crash using MSCrashes","tracedFileLine":"486","tracedFile":"Project/ProjectServiceModule.swift","type":"generic","tracedFunction":"registerCommands(_:)"} 09:08:39 0fffffff EVENT - Trace - {"message":"Generating test crash using MSCrashes","tracedFileLine":"486","tracedFile":"Project/ProjectServiceModule.swift","type":"generic","tracedFunction":"registerCommands(_:)"} 09:08:39 0fffffff UNHANDLEDERROR - {"errorId":"xxx-5e7a-4407-9eb2-xxx","blobReference":"xxx-996d-4ac4-80f7-xxx/unhandled/raw/xxx-5e7a-4407-9eb2-xxx"} 09:08:41 0fffffff STARTSESSION - xxx-618c-45f5-a0c9-xxx 09:09:01

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A

Additional context It seems to be an issue related to MSCrashes.generateTestCrash() - if I force a crash by forced unwrapping of a nil optional, the event only gets tracked once!

winnie commented 5 years ago

@mylemans apologies for the delay. Can you please start a conversation in the blue chat bubble on the bottom right corner of App Center? You can link this issue and our team will route you to the proper support and engineering team to troubleshoot. Thanks!