rosenpin / Goaly

Goaly support repo
5 stars 0 forks source link

[BUG] Goaly is not scheduling #13

Closed opie4624 closed 1 year ago

opie4624 commented 1 year ago

Describe the bug The Goaly calendar was created through the Google Account linking, but no goals have been scheduled.

To Reproduce Steps to reproduce the behavior:

  1. Sign in with Google
  2. Create a goal
  3. View Goaly calendar, which is empty

Expected behavior Events scheduled on Goaly Calendar

Screenshots ![Uploading Screen Shot 2022-11-28 at 11.06.27 AM.png…]()

Smartphone (please complete the following information):

opie4624 commented 1 year ago

Ran adb and saw the following error upon creating a new goal:

11-28 11:18:13.603  6484  6514 E flutter : [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: No element
11-28 11:18:13.603  6484  6514 E flutter : #0      _GrowableList.first (dart:core-patch/growable_array.dart:343)
11-28 11:18:13.603  6484  6514 E flutter : #1      _GoalCreationIntroState.registerToScheduleFinishedEvents.<anonymous closure>.<anonymous closure> (package:goals_for_google_calendar/ui/intro/goal_intro.dart:137)
11-28 11:18:13.603  6484  6514 E flutter : #2      State.setState (package:flutter/src/widgets/framework.dart:1133)
11-28 11:18:13.603  6484  6514 E flutter : #3      _GoalCreationIntroState.registerToScheduleFinishedEvents.<anonymous closure> (package:goals_for_google_calendar/ui/intro/goal_intro.dart:135)
11-28 11:18:13.603  6484  6514 E flutter : #4      _Notifier.notifyListeners (package:fbroadcast/fbroadcast.dart:462)
11-28 11:18:13.603  6484  6514 E flutter : #5      _Notifier.value= (package:fbroadcast/fbroadcast.dart:409)
11-28 11:18:13.603  6484  6514 E flutter : #6      FBroadcast.broadcast (package:fbroadcast/fbroadcast.dart:112)
11-28 11:18:13.603  6484  6514 E flutter : #7      EventsScheduler.scheduleEventsForDefaultPeriod (package:goals_for_google_calendar/scheduler/goals_scheduler/events_scheduler.dart:42)
11-28 11:18:13.603  6484  6514 E flutter : <asynchronous suspension>
11-28 11:18:13.603  6484  6514 E flutter :

It looks like there's a logfile created at /data/user/0/io.rosenpin.goals/app_flutter/goalsForGoogleCalendar.log. What's a good way to pull that? I will attach it to this bug.

rosenpin commented 1 year ago

Thanks for the detailed feedback
Firstly I'd check that you are logged in to your Google Calendar app with the same account you signed into Goaly
Are you using the standard Google Calendar app?

Regarding the logfile, it would be very helpful if you can pull it using adb pull /data/user/0/io.rosenpin.goals/app_flutter/goalsForGoogleCalendar.log
But you might be have to be rooted to do so
You could do adb shell su followed by the previous command
Please let me know if this is relevant

rosenpin commented 1 year ago

I don't see any errors in our Firebase reports for your device, do you have any adblock/vpn guard or something like that that might block requests to Google's APIs/Google analytics?

opie4624 commented 1 year ago

My phone isn't rooted, so I can't do the adb pull or the adb shell su.

There should be nothing blocking it. I just cleared storage and went through onboarding again. Is there a device ID I can provide you?

Notable thing: When I connect to Google Calendar, the "New goal created!" page never shows checkmarks next to the "View events" "Track your goals" and "Statistics" items. It just shows the wavy blocks forever.

rosenpin commented 1 year ago

Interesting

Please make sure that you're using the same Google account in both Google Calendar and Goaly

How long are you waiting for the "New Goal Created" screen to load? If it's more than a minute there might be a problem in the connection between your device and Google Calendar API

rosenpin commented 1 year ago

It's possible that no errors are recorded because technically no exception is thrown in the code.
Maybe it just loads indefinitely without getting a response from Google API
This could be because of internet connection issues, Google blocking the user, VPN/country limiting connectivity to Google etc.

For now, I would recommend reinstalling the app and using it without Google Calendar support (using the continue without Google button)
This will limit the app's functionality but will at least solve the connectivity issue

@opie4624 if you are willing to help investigate this issue further please send me an email and we will try to gather more information in order to solve it

opie4624 commented 1 year ago

I am confident that internet connection issues aren't the issue. Last time I attempted it, the New Goal Created screen was "loading" for 10+ minutes with no progress. I'm in the US on Starlink, but I also tested from my cell provider connection (Verizon, solid 5G connection) with the same result. I'm confident that I've eliminated connectivity as an issue. Using the app without Google Calendar support does work, so I can always do that in a pinch. I'll reach out via email and we can try to coax some more details out on what's happening.

rosenpin commented 1 year ago

Thank you for your help @opie4624 !
We found the bug
I opened 3 concrete issues that will solve this bug
closing this discussion now, you can subscribe to the new issues to follow the progress on this