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

Very odd gaps between StartServiceLog and StartSessionLog #1789

Open
munkii opened this issue Oct 2, 2024 · 2 comments
Open

Very odd gaps between StartServiceLog and StartSessionLog #1789

munkii opened this issue Oct 2, 2024 · 2 comments
Labels

Comments

@munkii
Copy link

munkii commented Oct 2, 2024

Gaps between StartSessionLog call and StartSessionLog call from 55mins to 11hours with nothing logged in between Description

Please describe the issue you are facing using the SDK.

Repro Steps

Please list the steps used to reproduce your issue.

  1. We have a Xamarin Forms app that uses Microsoft.AppCenter.Analytics and Microsoft.AppCenter.Crashes version 5.0.3
  2. We export those logs to Azure AppInSights

Details

  1. Whilst investigating some odd behvior where our app was sending expired Azure B2C Access Tokens we were macthing the failed requests to AppCenter logs. Of the 8 occurences of this expired token issue i can match them to 6 failures in the AppCenter logs

  2. They are all iOS users but that could be a coincidence

  3. In the logs i see something like this each time

Timestamp name
9/28/2024, 6:40:05.638 PM StartSessionLog
9/28/2024, 6:37:29.081 PM StartSessionLog
9/28/2024, 6:00:54.541 PM DataSyncService - Sync All Finished
  LOTS OF LOG ROWS NOT INCLUDED Nothng unusual
9/28/2024, 6:00:30.862 PM DataSyncService - Sync All Requested
9/28/2024, 6:00:30.850 PM ThirdPartyService - Sync All Completed
9/28/2024, 6:00:27.821 PM ThirdPartyService - Sync All Requested
9/28/2024, 6:00:26.601 PM StartSessionLog
9/28/2024, 5:05:00.723 PM ViewModel - HomeViewModel Appearing
9/28/2024, 5:05:00.349 PM Connecting UserId To AppCenter
9/28/2024, 5:04:59.866 PM StartServiceLog

Note the 55minute gap between one log 'ViewModel - HomeViewModel Appearing' and the 'StartSessionLog'. I have seen one occurence where the gao to StartSesssionLog was 11hours

@munkii munkii added the support label Oct 2, 2024
@IlyaBausovAkvelon
Copy link

IlyaBausovAkvelon commented Oct 11, 2024

Hi @munkii, thank you for reporting!
Could you please tell us how AppCenter.Analytics is being started in the app? Where is called Appcenter.Start?
Is App being put into background right after launch? I am asking because Analytics is trying to send start session event while initializing and after app is being put back to foreground.

@munkii
Copy link
Author

munkii commented Oct 17, 2024

We call it in Xamarin.Forms.Application OnStart

protected override void OnStart()
{
#if !RELEASE_LIVECONFIG
	AppCenter.Start(
		$"ios={AppSettings.AppCenterAnalyticsIosDevTest};" +
		$"android={AppSettings.AppCenterAnalyticsAndroidDevTest}",
		typeof(Analytics),
		typeof(Crashes));
#else
	AppCenter.Start(
		$"ios={AppSettings.AppCenterAnalyticsIos};" +
		$"android={AppSettings.AppCenterAnalyticsAndroid}",
		typeof(Analytics),
		typeof(Crashes));
#endif

	base.OnStart();

	Page pageToShow = null;

	if (Xamarin.Essentials.VersionTracking.IsFirstLaunchEver == false)
	{
		pageToShow = FreshPageModelResolver.ResolvePageModel<HomeViewModel>();
	}
	else
	{
		pageToShow = FreshPageModelResolver.ResolvePageModel<FirstRunViewModel>();
	}

	var mainNavContainer = new FreshNavigationContainer(pageToShow, NavigationContainerNames.MainContainer);
	this.MainPage = mainNavContainer;

	App.Current.On<Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
}

Is App being put into background right after launch?
To be honest I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants