cusac / mbt.guide

MIT License
4 stars 1 forks source link

Random logout #84

Open oormicreations opened 3 years ago

oormicreations commented 3 years ago

App logs out at random times. User loses the work.

JKHeadley commented 3 years ago

This might be due to a user's session timing out so their session token expires. This happens when a user is inactive for a period of time. If this is the case we can look at the session token life time and increase it if necessary.

You should be able to tell if this is the case by inspecting the console output when it occurs and see if there are any "token expired" messages.

oormicreations commented 3 years ago

Seems to be session timeout. But it happened a few times while I was working (typing, refreshing etc). Anyhow, there has to be a way to autosave before time out happens.

oormicreations commented 3 years ago

This is the console output I got today. It looks like there is some countdown, and when it cannot save, it logs out. (This is on main site, not my local one)

Screenshot from 2021-02-02 19-16-08

JKHeadley commented 3 years ago

@oormicreations it turns out the expiration times are actually good. I was looking at a temporary value I had set for testing. Here are the actual values:

Screen Shot 2021-02-03 at 7 48 12 AM

At this point I suspect the bug is caused by some of the more recent changes on the frontend. Next time you experience this, could you try taking a screenshot of the network log? It looks like this:

Screen Shot 2021-02-03 at 7 54 40 AM
oormicreations commented 3 years ago

Sure, I will do that. It did not log me out today, I worked on a video for one hour today.

oormicreations commented 3 years ago

My netwrok info remains completely blank. I guess I need to keep it open to record anything. But here is another screenshot. Video played for 10 mins, and as soon as I typed something, it logged me out. Probably it is because of slow network here, the app does not authenticate quickly enough. Every time it tries to autosave, it tries to authenticate, which seems to be failing often.

Screenshot from 2021-02-04 21-26-24

oormicreations commented 3 years ago

Here it is :

Request URL: https://mbt.api.appyapp.io/update-video-segments
Request Method: POST
Status Code: 401 
Remote Address: 3.131.204.145:443
Referrer Policy: strict-origin-when-cross-origin
access-control-allow-origin: http://localhost:3000
access-control-expose-headers: WWW-Authenticate,Server-Authorization
cache-control: no-cache
content-length: 120
content-type: application/json; charset=utf-8
date: Fri, 05 Feb 2021 01:40:09 GMT
server: nginx/1.16.1
status: 401
vary: origin
www-authenticate: Token error="Expired Access Token"
:authority: mbt.api.appyapp.io
:method: POST
:path: /update-video-segments
:scheme: https
accept: application/json, text/plain, */*
accept-encoding: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lZ21lbnRzIiwicmVtb3ZlVXNlclBlcm1pc3Npb25zIiwidXBkYXRlVmlkZW8iLCJjcmVhdGVWaXNpdG9yIiwicmVhZEF1ZGl0TG9nIiwiZGVhY3RpdmF0ZVVzZXIiLCJkaXNhYmxlVXNlciIsIm1hcmtDb252ZXJzYXRpb25Bc1VucmVhZCIsImVuYWJsZVVzZXIiLCJyZWNlaXZlQ2hhdE1lc3NhZ2VzIiwicmVhZFVzZXJTY29wZSIsInJlY2VpdmVOb3RpZmljYXRpb25zIiwicmVhZFVzZXJDb25uZWN0aW9uU3RhdHMiLCJ1cGxvYWRJbWFnZSIsImFjdGl2YXRlVXNlciIsInJlYWRNeUNvbnZlcnNhdGlvbnMiLCJwb3N0Q2hhdE1lc3NhZ2UiLCJtYXJrQ29udmVyc2F0aW9uQXNSZWFkIiwidXBsb2FkUHJvZmlsZUltYWdlIiwicmVhZEF2YWlsYWJsZU5vdGlmaWNhdGlvbnMiLCJ1c2VyLTVmNTA1OTUyZjBkYzEzMDAxMjQ4OTIyZCJdLCJpYXQiOjE2MTI0MjAwMzQsImV4cCI6MTYxMjQyMDYzNH0.BI0YgHsaGXK_GVaud1U5lZNJaTEPctIZqboz6yPqOZk
content-length: 686
content-type: application/json;charset=UTF-8
origin: http://localhost:3000
referer: http://localhost:3000/
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36
{videoId: "t0qQVNKxEYY", segments: [,…]}
segments: [,…]
0: {segmentId: "3c7f7045-0164-4340-aa2c-2d507664022d", video: "5fc596a1b1a4f300127b6fd4", start: 1490,…}
1: {segmentId: "5734dd3a-e7d5-4344-95b8-ba8cc1c39380", video: "5fc596a1b1a4f300127b6fd4", start: 2130,…}
videoId: "t0qQVNKxEYY"