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

Javascript: errors prevent full-page loader from being removed #265

Closed
toconnell opened this Issue Jul 30, 2017 · 6 comments

Comments

Projects
1 participant
@toconnell
Owner

toconnell commented Jul 30, 2017

From email:

[597a93828740d90ad4a50bac] has submitted an error report!

The report goes as follows:
I'm getting a permanent loading pinwheel on every page, even though I can see that everything loaded properly behind the pinwheel? Can't click on anything

And:

Hey Tim,

I get the pinwheel spinning forever on my mobile device. Standard iphone, I think I get the error on the Settlement Sheet, Survivor Sheet, and the Campaign page. I can see the information loaded behind the pinwheel, but it never seems to go away and it whites out the backgrounds. Checked the issue on my PC and it seems like there are no problems there. Thanks

@toconnell toconnell self-assigned this Jul 30, 2017

@toconnell toconnell changed the title from iOS: page load JS error fails to hide the loading spinner to Javascript: errors prevent full-page loader from being removed Sep 7, 2017

@toconnell

This comment has been minimized.

Show comment
Hide comment
@toconnell

toconnell Sep 7, 2017

Owner

I think this is also to blame on the now-deprecated apiService factory.

Once I refactor the Survivor Sheet to work like the Settlement Sheet and one-shot its init method, I'll check this out on Windows with a few browsers and see if I can reproduce.

tldr; I think multiple API hits during initialize() and reinitialize() are to blame for this.

Owner

toconnell commented Sep 7, 2017

I think this is also to blame on the now-deprecated apiService factory.

Once I refactor the Survivor Sheet to work like the Settlement Sheet and one-shot its init method, I'll check this out on Windows with a few browsers and see if I can reproduce.

tldr; I think multiple API hits during initialize() and reinitialize() are to blame for this.

@toconnell

This comment has been minimized.

Show comment
Hide comment
@toconnell

toconnell Sep 7, 2017

Owner

Yeah, this seems to go away with the new routine for one-shot initialization. I'm leaving it open until final QA on this release.

Owner

toconnell commented Sep 7, 2017

Yeah, this seems to go away with the new routine for one-shot initialization. I'm leaving it open until final QA on this release.

@toconnell

This comment has been minimized.

Show comment
Hide comment
@toconnell

toconnell Sep 9, 2017

Owner

I saw something during the last deploy that I think is related to this:

[2017-09-09 13:34:44] INFO:     [toconnell@tyrannybelle.com (565f3d67421aa95c4af1e230)] authorization check failed: Signature has expired!
[2017-09-09 13:34:50] INFO:     Converted principles from names (legacy) to handles for settlements object 'Gravestone' [58d05a518740d90e66f7252d]
[2017-09-09 13:34:50] INFO:     settlements object 'Gravestone' [58d05a518740d90e66f7252d] settlement modified during normalization! Saving changes...
[2017-09-09 13:34:50] INFO:     Saved settlements object 'Gravestone' [58d05a518740d90e66f7252d] to mdb.settlements successfully!
[2017-09-09 13:34:55] ERROR:    Incorrectly formatted token!
[2017-09-09 13:34:55] ERROR:    Incorrectly formatted token!
[2017-09-09 13:34:55] ERROR:    Incorrectly formatted token!

The actual code is in the API's User class methods:

153 def token_to_object(request, strict=True):
154     """ Processes the "Authorization" param in the header and returns an http
155     response OR a user object. Requires the application's initialized JWT to
156     work. """
157
158     # first, get the token or bail
159
160     auth_token = request.headers.get("Authorization", None)
161     if auth_token is None:
162         logger.error("Authorization header missing!")
163         return utils.http_401
164
165     # now, try to decode the token and get a dict
166
167     try:
168         decoded = jwt.decode(auth_token, secret_key, verify=strict)
169         user_dict = dict(json.loads(decoded["identity"]))
170         return User(_id=user_dict["_id"]["$oid"])
171     except jwt.DecodeError:
172         logger.error("Incorrectly formatted token!")
173     except Exception as e:
174         logger.exception(e)
175
176     return utils.http_401

tl;dr I think there's something going on in the Legacy Webapp where it sends a badly/incorrectly formatted Authorization header (e.g. with an old JWT or something).

Owner

toconnell commented Sep 9, 2017

I saw something during the last deploy that I think is related to this:

[2017-09-09 13:34:44] INFO:     [toconnell@tyrannybelle.com (565f3d67421aa95c4af1e230)] authorization check failed: Signature has expired!
[2017-09-09 13:34:50] INFO:     Converted principles from names (legacy) to handles for settlements object 'Gravestone' [58d05a518740d90e66f7252d]
[2017-09-09 13:34:50] INFO:     settlements object 'Gravestone' [58d05a518740d90e66f7252d] settlement modified during normalization! Saving changes...
[2017-09-09 13:34:50] INFO:     Saved settlements object 'Gravestone' [58d05a518740d90e66f7252d] to mdb.settlements successfully!
[2017-09-09 13:34:55] ERROR:    Incorrectly formatted token!
[2017-09-09 13:34:55] ERROR:    Incorrectly formatted token!
[2017-09-09 13:34:55] ERROR:    Incorrectly formatted token!

The actual code is in the API's User class methods:

153 def token_to_object(request, strict=True):
154     """ Processes the "Authorization" param in the header and returns an http
155     response OR a user object. Requires the application's initialized JWT to
156     work. """
157
158     # first, get the token or bail
159
160     auth_token = request.headers.get("Authorization", None)
161     if auth_token is None:
162         logger.error("Authorization header missing!")
163         return utils.http_401
164
165     # now, try to decode the token and get a dict
166
167     try:
168         decoded = jwt.decode(auth_token, secret_key, verify=strict)
169         user_dict = dict(json.loads(decoded["identity"]))
170         return User(_id=user_dict["_id"]["$oid"])
171     except jwt.DecodeError:
172         logger.error("Incorrectly formatted token!")
173     except Exception as e:
174         logger.exception(e)
175
176     return utils.http_401

tl;dr I think there's something going on in the Legacy Webapp where it sends a badly/incorrectly formatted Authorization header (e.g. with an old JWT or something).

@toconnell

This comment has been minimized.

Show comment
Hide comment
@toconnell

toconnell Sep 9, 2017

Owner

These are popping up periodically as well:

[2017-09-09 15:15:04] ERROR:    Error attempting to process cookie!
[2017-09-09 15:15:04] ERROR:
[2017-09-09 15:15:06] ERROR:    Error attempting to process cookie!
[2017-09-09 15:15:06] ERROR:
Owner

toconnell commented Sep 9, 2017

These are popping up periodically as well:

[2017-09-09 15:15:04] ERROR:    Error attempting to process cookie!
[2017-09-09 15:15:04] ERROR:
[2017-09-09 15:15:06] ERROR:    Error attempting to process cookie!
[2017-09-09 15:15:06] ERROR:
@toconnell

This comment has been minimized.

Show comment
Hide comment
@toconnell

toconnell Sep 18, 2017

Owner

This may also be related to #283 (#283)

Owner

toconnell commented Sep 18, 2017

This may also be related to #283 (#283)

@toconnell

This comment has been minimized.

Show comment
Hide comment
@toconnell

toconnell Oct 30, 2017

Owner

Closing this. Haven't heard about it in donkeys' years: assuming it was fixed back when we started doing single init calls from the angular app.

Owner

toconnell commented Oct 30, 2017

Closing this. Haven't heard about it in donkeys' years: assuming it was fixed back when we started doing single init calls from the angular app.

@toconnell toconnell closed this Oct 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment