{"action":"created","comment":{"url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/comments/189970244","pull_request_review_id":122252734,"id":189970244,"diff_hunk":"@@ -196,11 +195,15 @@ def _close_user_reading_sessions(cls, db_session, user_id):\n         query = query.filter(cls.is_active == True)\n         reading_sessions = query.all()\n         for reading_session in reading_sessions:\n-            reading_session.is_active = False\n             time_diff = reading_session.last_action_time - reading_session.start_time\n-            reading_session.duration = time_diff.total_seconds() * 1000  # Convert to miliseconds\n-            db_session.add(reading_session)\n-        db_session.commit()\n+            #If the duration is zero, we delete the session\n+            if time_diff.total_seconds() == 0:","path":"zeeguu/model/user_reading_session.py","position":31,"original_position":31,"commit_id":"69ccf10fbe6db9b2a3239834aff2556044c05c52","original_commit_id":"69ccf10fbe6db9b2a3239834aff2556044c05c52","user":{"login":"mircealungu","id":464519,"avatar_url":"https://avatars2.githubusercontent.com/u/464519?v=4","gravatar_id":"","url":"https://api.github.com/users/mircealungu","html_url":"https://github.com/mircealungu","followers_url":"https://api.github.com/users/mircealungu/followers","following_url":"https://api.github.com/users/mircealungu/following{/other_user}","gists_url":"https://api.github.com/users/mircealungu/gists{/gist_id}","starred_url":"https://api.github.com/users/mircealungu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mircealungu/subscriptions","organizations_url":"https://api.github.com/users/mircealungu/orgs","repos_url":"https://api.github.com/users/mircealungu/repos","events_url":"https://api.github.com/users/mircealungu/events{/privacy}","received_events_url":"https://api.github.com/users/mircealungu/received_events","type":"User","site_admin":false},"body":"short comment on why / how could the session duration end up being zero?","created_at":"2018-05-22T16:34:50Z","updated_at":"2018-05-22T16:34:50Z","html_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core/pull/66#discussion_r189970244","pull_request_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/comments/189970244"},"html":{"href":"https://github.com/zeeguu-ecosystem/Zeeguu-Core/pull/66#discussion_r189970244"},"pull_request":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66","id":189007530,"html_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core/pull/66","diff_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core/pull/66.diff","patch_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core/pull/66.patch","issue_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/66","number":66,"state":"open","locked":false,"title":"Patch for not closed articles. Fix 0 duration sessions","user":{"login":"carlospaz7","id":22192247,"avatar_url":"https://avatars1.githubusercontent.com/u/22192247?v=4","gravatar_id":"","url":"https://api.github.com/users/carlospaz7","html_url":"https://github.com/carlospaz7","followers_url":"https://api.github.com/users/carlospaz7/followers","following_url":"https://api.github.com/users/carlospaz7/following{/other_user}","gists_url":"https://api.github.com/users/carlospaz7/gists{/gist_id}","starred_url":"https://api.github.com/users/carlospaz7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlospaz7/subscriptions","organizations_url":"https://api.github.com/users/carlospaz7/orgs","repos_url":"https://api.github.com/users/carlospaz7/repos","events_url":"https://api.github.com/users/carlospaz7/events{/privacy}","received_events_url":"https://api.github.com/users/carlospaz7/received_events","type":"User","site_admin":false},"body":"*When the JS does not insert the ARTICLE CLOSED event, we close the reading session when the user loads the list of articles.\r\n*When a reading session is opened but the user does not perform any interaction, and also the READING_SESSION_TIMEOUT is reached, the session was being created with 0 ms duration, therefore we delete this session instead.","created_at":"2018-05-18T12:12:55Z","updated_at":"2018-05-22T16:34:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cfb5b3c6e54f5f5c32c82d1795664abdaaec736","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66/commits","review_comments_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66/comments","review_comment_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/66/comments","statuses_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/statuses/69ccf10fbe6db9b2a3239834aff2556044c05c52","head":{"label":"zeeguu-ecosystem:user_working_session_2","ref":"user_working_session_2","sha":"69ccf10fbe6db9b2a3239834aff2556044c05c52","user":{"login":"zeeguu-ecosystem","id":32082278,"avatar_url":"https://avatars0.githubusercontent.com/u/32082278?v=4","gravatar_id":"","url":"https://api.github.com/users/zeeguu-ecosystem","html_url":"https://github.com/zeeguu-ecosystem","followers_url":"https://api.github.com/users/zeeguu-ecosystem/followers","following_url":"https://api.github.com/users/zeeguu-ecosystem/following{/other_user}","gists_url":"https://api.github.com/users/zeeguu-ecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/zeeguu-ecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeeguu-ecosystem/subscriptions","organizations_url":"https://api.github.com/users/zeeguu-ecosystem/orgs","repos_url":"https://api.github.com/users/zeeguu-ecosystem/repos","events_url":"https://api.github.com/users/zeeguu-ecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/zeeguu-ecosystem/received_events","type":"Organization","site_admin":false},"repo":{"id":83914717,"name":"Zeeguu-Core","full_name":"zeeguu-ecosystem/Zeeguu-Core","owner":{"login":"zeeguu-ecosystem","id":32082278,"avatar_url":"https://avatars0.githubusercontent.com/u/32082278?v=4","gravatar_id":"","url":"https://api.github.com/users/zeeguu-ecosystem","html_url":"https://github.com/zeeguu-ecosystem","followers_url":"https://api.github.com/users/zeeguu-ecosystem/followers","following_url":"https://api.github.com/users/zeeguu-ecosystem/following{/other_user}","gists_url":"https://api.github.com/users/zeeguu-ecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/zeeguu-ecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeeguu-ecosystem/subscriptions","organizations_url":"https://api.github.com/users/zeeguu-ecosystem/orgs","repos_url":"https://api.github.com/users/zeeguu-ecosystem/repos","events_url":"https://api.github.com/users/zeeguu-ecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/zeeguu-ecosystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core","description":null,"fork":false,"url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core","forks_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/forks","keys_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/teams","hooks_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/hooks","issue_events_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/events{/number}","events_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/events","assignees_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/assignees{/user}","branches_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/branches{/branch}","tags_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/tags","blobs_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/statuses/{sha}","languages_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/languages","stargazers_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/stargazers","contributors_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/contributors","subscribers_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/subscribers","subscription_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/subscription","commits_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/contents/{+path}","compare_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/merges","archive_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/downloads","issues_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues{/number}","pulls_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls{/number}","milestones_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/milestones{/number}","notifications_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/labels{/name}","releases_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/releases{/id}","deployments_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/deployments","created_at":"2017-03-04T18:19:40Z","updated_at":"2018-05-11T16:56:46Z","pushed_at":"2018-05-22T15:10:22Z","git_url":"git://github.com/zeeguu-ecosystem/Zeeguu-Core.git","ssh_url":"git@github.com:zeeguu-ecosystem/Zeeguu-Core.git","clone_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core.git","svn_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core","homepage":null,"size":2234,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":33,"watchers":1,"default_branch":"master"}},"base":{"label":"zeeguu-ecosystem:master","ref":"master","sha":"0eb025b5ed00e8c30dc3343c9616ba041aeffd7f","user":{"login":"zeeguu-ecosystem","id":32082278,"avatar_url":"https://avatars0.githubusercontent.com/u/32082278?v=4","gravatar_id":"","url":"https://api.github.com/users/zeeguu-ecosystem","html_url":"https://github.com/zeeguu-ecosystem","followers_url":"https://api.github.com/users/zeeguu-ecosystem/followers","following_url":"https://api.github.com/users/zeeguu-ecosystem/following{/other_user}","gists_url":"https://api.github.com/users/zeeguu-ecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/zeeguu-ecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeeguu-ecosystem/subscriptions","organizations_url":"https://api.github.com/users/zeeguu-ecosystem/orgs","repos_url":"https://api.github.com/users/zeeguu-ecosystem/repos","events_url":"https://api.github.com/users/zeeguu-ecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/zeeguu-ecosystem/received_events","type":"Organization","site_admin":false},"repo":{"id":83914717,"name":"Zeeguu-Core","full_name":"zeeguu-ecosystem/Zeeguu-Core","owner":{"login":"zeeguu-ecosystem","id":32082278,"avatar_url":"https://avatars0.githubusercontent.com/u/32082278?v=4","gravatar_id":"","url":"https://api.github.com/users/zeeguu-ecosystem","html_url":"https://github.com/zeeguu-ecosystem","followers_url":"https://api.github.com/users/zeeguu-ecosystem/followers","following_url":"https://api.github.com/users/zeeguu-ecosystem/following{/other_user}","gists_url":"https://api.github.com/users/zeeguu-ecosystem/gists{/gist_id}","starred_url":"https://api.github.com/users/zeeguu-ecosystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeeguu-ecosystem/subscriptions","organizations_url":"https://api.github.com/users/zeeguu-ecosystem/orgs","repos_url":"https://api.github.com/users/zeeguu-ecosystem/repos","events_url":"https://api.github.com/users/zeeguu-ecosystem/events{/privacy}","received_events_url":"https://api.github.com/users/zeeguu-ecosystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core","description":null,"fork":false,"url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core","forks_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/forks","keys_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/teams","hooks_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/hooks","issue_events_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/events{/number}","events_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/events","assignees_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/assignees{/user}","branches_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/branches{/branch}","tags_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/tags","blobs_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/statuses/{sha}","languages_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/languages","stargazers_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/stargazers","contributors_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/contributors","subscribers_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/subscribers","subscription_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/subscription","commits_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/contents/{+path}","compare_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/merges","archive_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/downloads","issues_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues{/number}","pulls_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls{/number}","milestones_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/milestones{/number}","notifications_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/labels{/name}","releases_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/releases{/id}","deployments_url":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/deployments","created_at":"2017-03-04T18:19:40Z","updated_at":"2018-05-11T16:56:46Z","pushed_at":"2018-05-22T15:10:22Z","git_url":"git://github.com/zeeguu-ecosystem/Zeeguu-Core.git","ssh_url":"git@github.com:zeeguu-ecosystem/Zeeguu-Core.git","clone_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core.git","svn_url":"https://github.com/zeeguu-ecosystem/Zeeguu-Core","homepage":null,"size":2234,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":3,"open_issues":33,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66"},"html":{"href":"https://github.com/zeeguu-ecosystem/Zeeguu-Core/pull/66"},"issue":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/66"},"comments":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/zeeguu-ecosystem/Zeeguu-Core/statuses/69ccf10fbe6db9b2a3239834aff2556044c05c52"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mircealungu"}}