e-mission / e-mission-data-collection

Repository for our own data collection
BSD 3-Clause "New" or "Revised" License
4 stars 19 forks source link

State diagram: fix restart after config + 5 mins fix #136

Closed shankari closed 8 years ago

shankari commented 8 years ago

115 seems to be fixed on android

in WAITING_FOR_TRIP_START

10-26 23:05:41.160  24474-24518/edu.berkeley.eecs.emission I/System.out﹕ All preferences are {setup_complete=152, TripDiaryCurrState=local.state.waiting_for_trip_start}
10-26 23:05:41.169  24474-24518/edu.berkeley.eecs.emission D/TripDiaryStateMachineReceiver﹕ Setup complete, skipping initialize
10-26 23:05:41.200  24474-24518/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key background/battery at time 1.477548341174E9
10-26 23:05:41.208  24474-24518/edu.berkeley.eecs.emission I/ServerSyncAdapter﹕ Finished sync, sending local broadcast
10-26 23:12:52.940  24474-24474/edu.berkeley.eecs.emission I/chromium﹕ [INFO:CONSOLE(288)] "settings popup = [object Object]", source: file:///android_asset/www/js/control.js (288)
10-26 23:12:56.306  24474-24474/edu.berkeley.eecs.emission I/chromium﹕ [INFO:CONSOLE(0)] "Ignored attempt to cancel a touchend event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.", source:  (0)
10-26 23:12:57.110  24474-24474/edu.berkeley.eecs.emission E/chromium﹕ [ERROR:xwalk_autofill_client.cc(121)] Not implemented reached in virtual void xwalk::XWalkAutofillClient::OnFirstUserGestureObserved()
10-26 23:13:11.585  24474-24474/edu.berkeley.eecs.emission I/chromium﹕ [INFO:CONSOLE(0)] "Ignored attempt to cancel a touchend event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.", source:  (0)
10-26 23:13:12.575  24474-24474/edu.berkeley.eecs.emission I/chromium﹕ [INFO:CONSOLE(311)] "new config = [object Object]", source: file:///android_asset/www/js/control.js (311)
10-26 23:13:12.595  24474-24594/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key config/sensor_config at time 1.477548792579E9
10-26 23:13:12.597  24474-24594/edu.berkeley.eecs.emission W/PluginManager﹕ THREAD WARNING: exec() call to DataCollection.setConfig blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
10-26 23:13:12.597  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineReceiver﹕ noarg constructor called
10-26 23:13:12.603  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineReceiver﹕ TripDiaryStateMachineReciever onReceive(android.app.ReceiverRestrictedContext@a21d303, Intent { act=local.transition.stop_tracking flg=0x10 cmp=edu.berkeley.eecs.emission/.cordova.tracker.location.TripDiaryStateMachineReceiver }) called
10-26 23:13:12.610  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineService﹕ Service created. Initializing one-time variables!
10-26 23:13:12.615  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ service started with flags = 0 startId = 1 action = local.transition.stop_tracking
10-26 23:13:12.620  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ after reading from the prefs, the current state is local.state.waiting_for_trip_start
10-26 23:13:12.630  24474-24474/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key statemachine/transition at time 1.477548792621E9
10-26 23:13:12.638  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ Launched connect to the google API client, returning from onStartCommand
10-26 23:13:12.653  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ onConnected(null) called
10-26 23:13:12.657  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ handleAction(local.state.waiting_for_trip_start, local.transition.stop_tracking) calle
10-26 23:13:12.668  24474-24474/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key background/battery at time 1.47754879266E9
10-26 23:13:12.673  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ TripDiaryStateMachineReceiver handleTripStart(local.transition.stop_tracking) called
10-26 23:13:12.680  24474-24474/edu.berkeley.eecs.emission D/CreateGeofenceAction﹕ Removing geofence with ID = DYNAMIC_EXIT_GEOFENCE
10-26 23:13:12.698  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ newState after handling action is local.state.tracking_stopped
10-26 23:13:12.711  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ newState saved in prefManager is local.state.tracking_stopped
10-26 23:13:12.719  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineService﹕ Service destroyed. So long, suckers!
10-26 23:13:13.600  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineReceiver﹕ noarg constructor called
10-26 23:13:13.613  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineReceiver﹕ TripDiaryStateMachineReciever onReceive(android.app.ReceiverRestrictedContext@a21d303, Intent { act=local.transition.start_tracking flg=0x10 cmp=edu.berkeley.eecs.emission/.cordova.tracker.location.TripDiaryStateMachineReceiver }) called
10-26 23:13:13.628  24474-24474/edu.berkeley.eecs.emission I/TripDiaryStateMachineService﹕ Service created. Initializing one-time variables!
10-26 23:13:13.634  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ service started with flags = 0 startId = 1 action = local.transition.start_tracking
10-26 23:13:13.641  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ after reading from the prefs, the current state is local.state.tracking_stopped
10-26 23:13:13.650  24474-24474/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key statemachine/transition at time 1.477548793643E9
10-26 23:13:13.654  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ Launched connect to the google API client, returning from onStartCommand
10-26 23:13:13.672  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ onConnected(null) called
10-26 23:13:13.677  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ handleAction(local.state.tracking_stopped, local.transition.start_tracking) calle
10-26 23:13:13.687  24474-24474/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key background/battery at time 1.477548793679E9
10-26 23:13:13.691  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ TripDiaryStateMachineReceiver handleTrackingStopped(local.transition.start_tracking) called
10-26 23:13:13.696  24474-29850/edu.berkeley.eecs.emission I/System.out﹕ Running in new thread!!
10-26 23:13:13.711  24474-29850/edu.berkeley.eecs.emission D/CreateGeofenceAction﹕ Last location would have been Location[fused 37.390724,-122.086446 acc=38 et=+7d6h25m18s740ms] if we hadn't reset it
10-26 23:13:13.722  24474-29850/edu.berkeley.eecs.emission D/CreateGeofenceAction﹕ Last location is Location[fused 37.390724,-122.086446 acc=38 et=+7d6h25m18s740ms] using it
10-26 23:13:13.727  24474-29850/edu.berkeley.eecs.emission D/CreateGeofenceAction﹕ creating geofence at location Location[fused 37.390724,-122.086446 acc=38 et=+7d6h25m18s740ms]
10-26 23:13:13.735  24474-29850/edu.berkeley.eecs.emission D/CreateGeofenceAction﹕ creating geofence at location 37.3907237, -122.0864462
10-26 23:13:13.760  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ newState after handling action is local.state.waiting_for_trip_start
10-26 23:13:13.771  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ newState saved in prefManager is local.state.waiting_for_trip_start

in STOPPED_TRACKING, sent INITIALIZE

10-26 23:48:57.921  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ handleAction(local.state.tracking_stopped, local.transition.initialize) calle
10-26 23:48:57.933  24474-24474/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key background/battery at time 1.477550937924E9
10-26 23:48:57.937  24474-24474/edu.berkeley.eecs.emission D/TripDiaryStateMachineService﹕ TripDiaryStateMachineReceiver handleStarted(local.transition.initialize) called

in STOPPED_TRACKING, reconfigured

10-26 23:51:00.909  24474-24474/edu.berkeley.eecs.emission I/chromium﹕ [INFO:CONSOLE(311)] "new config = [object Object]", source: file:///android_asset/www/js/control.js (311)
10-26 23:51:00.927  24474-24594/edu.berkeley.eecs.emission D/BuiltinUserCache﹕ Added value for key config/sensor_config at time 1.477551060909E9
10-26 23:51:00.935  24474-24594/edu.berkeley.eecs.emission I/TripDiaryStateMachineReceiver﹕ in restartCollection, tracking is already stopped  new config will be picked up when it starts early return
shankari commented 8 years ago

Works on iOS as well (on reconfigure). We don't initialize on iOS, so no need to test that.

We stop tracking

Oct 27 08:14:17 ucb-sdb-iphone-4 emission[1843] <Warning>: Moved from STATE_WAITING_FOR_TRIP_START to STATE_TRACKING_STOPPED
Oct 27 08:14:17 ucb-sdb-iphone-4 emission[1843] <Warning>: DEBUG: Moved from STATE_WAITING_FOR_TRIP_START to STATE_TRACKING_STOPPED
Oct 27 08:14:17 ucb-sdb-iphone-4 emission[1843] <Warning>: Received notification T_TRACKING_STOPPED while processing silent push notification
Oct 27 08:14:17 ucb-sdb-iphone-4 emission[1843] <Warning>: DEBUG: Received notification T_TRACKING_STOPPED while processing silent push notification
Oct 27 08:14:17 ucb-sdb-iphone-4 emission[1843] <Warning>: Received notification T_FORCE_STOP_TRACKING while processing silent push notification
Oct 27 08:14:17 ucb-sdb-iphone-4 emission[1843] <Warning>: DEBUG: Received notification T_FORCE_STOP_TRACKING while processing silent push notification

We reconfigure.

Oct 27 08:14:27 ucb-sdb-iphone-4 emission[1843] <Warning>: settings popup = [object Object]
Oct 27 08:14:40 ucb-sdb-iphone-4 emission[1843] <Warning>: new config = [object Object]

Early return because tracking is stopped.

Oct 27 08:14:40 ucb-sdb-iphone-4 emission[1843] <Warning>: in restartCollection, state is already TRACKING_STOPPED, early return
Oct 27 08:14:40 ucb-sdb-iphone-4 emission[1843] <Warning>: DEBUG: in restartCollection, state is already TRACKING_STOPPED, early return
shankari commented 8 years ago

Auth code removal was in https://github.com/e-mission/cordova-jwt-auth/pull/9