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

Few more cleanup issues #13

Open
shankari opened this issue Aug 29, 2017 · 1 comment
Open

Few more cleanup issues #13

shankari opened this issue Aug 29, 2017 · 1 comment

Comments

@shankari
Copy link
Contributor

Few more cleanup issues for #9

  • move the "set settings" code to a separate module
  • set a client field in the profile when the user switches to a different client (at least by URL)
  • reflect the results of the user prompt back to the diary (will be tracked in a different bug)
@shankari
Copy link
Contributor Author

Also, really need to think through the settings code on startup. For example, the base app is a thin skin and does not make any server calls or collect any data. So it theoretically should not need to set any settings. HOWEVER, if I remove all the startup code (https://github.com/e-mission/e-mission-base/blob/master/www/js/app.js#L51), then when I do try to switch clients, I get an error

2018-10-16 09:22:57.297629-0700 emTripLog[40466:26103833] *** Terminating app due to uncaught exception 'SettingsNotFound', reason: 'Connection settings not saved to database!'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010a9391e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x0000000109f05031 objc_exception_throw + 48
	2   emTripLog                           0x00000001067bd179 -[ConnectionSettings nativeAuth] + 137
	3   emTripLog                           0x00000001067bd218 -[ConnectionSettings authMethod] + 40
	4   emTripLog                           0x00000001067a12f0 +[AuthTokenCreationFactory getInstance] + 80
	5   emTripLog                           0x000000010679ea7d -[BEMJWTAuth applicationLaunchedWithUrl:] + 61
	6   CoreFoundation                      0x000000010a8d4b8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
	7   CoreFoundation                      0x000000010a8d4a65 _CFXRegistrationPost + 453
	8   CoreFoundation                      0x000000010a8d47a1 ___CFXNotificationPost_block_invoke + 225
	9   CoreFoundation                      0x000000010a896422 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1826
	10  CoreFoundation                      0x000000010a8955a1 _CFXNotificationPost + 609
	11  emTripLog                           0x00000001067a93e4 -[AppDelegate(datacollection) application:openURL:options:] + 244
	12  UIKit                               0x000000010b13e237 __58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke + 869
	13  UIKit                               0x000000010b13dbd1 -[UIApplication _applicationOpenURLAction:payload:origin:] + 652
	14  UIKit                               0x000000010b14ae9f -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 4851
	15  UIKit                               0x000000010b4f67a1 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1641
	16  UIKit                               0x000000010be67614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
	17  UIKit                               0x000000010be674ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433

Basically, the auth code is also triggered when we open the URL, and in the auth code startup, we assume that the settings should already be set.

I think that we had some assumptions about when settings should be configured using javascript, but we need to work through the design choices and come up with a unified workflow

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

No branches or pull requests

1 participant