{"action":"closed","number":2625,"pull_request":{"url":"https://api.github.com/repos/status-im/status-react/pulls/2625","id":156711189,"html_url":"https://github.com/status-im/status-react/pull/2625","diff_url":"https://github.com/status-im/status-react/pull/2625.diff","patch_url":"https://github.com/status-im/status-react/pull/2625.patch","issue_url":"https://api.github.com/repos/status-im/status-react/issues/2625","number":2625,"state":"closed","locked":false,"title":"Simplified message loading","user":{"login":"janherich","id":1910609,"avatar_url":"https://avatars1.githubusercontent.com/u/1910609?v=4","gravatar_id":"","url":"https://api.github.com/users/janherich","html_url":"https://github.com/janherich","followers_url":"https://api.github.com/users/janherich/followers","following_url":"https://api.github.com/users/janherich/following{/other_user}","gists_url":"https://api.github.com/users/janherich/gists{/gist_id}","starred_url":"https://api.github.com/users/janherich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janherich/subscriptions","organizations_url":"https://api.github.com/users/janherich/orgs","repos_url":"https://api.github.com/users/janherich/repos","events_url":"https://api.github.com/users/janherich/events{/privacy}","received_events_url":"https://api.github.com/users/janherich/received_events","type":"User","site_admin":false},"body":"[comment]: # (Please replace ... with your information. Remove < and >)\r\n[comment]: # (To auto-close issue on merge, please insert the related issue number after # i.e fixes #566)\r\n\r\nThis is super small partial change related to much bigger refactor for consistency and (most importantly) performance gains (resulting from drastically decreased number of subscriptions) which I'm doing as part of the #1875 story. \r\nAfter last feedback from @oskarth, I'm trying to split the work into small, easy to review chunks, that's why this PR.\r\n\r\nChanges:\r\n* Simplified logic of the `:load-more-messages` handler\r\n* Got rid of the global `:loading-allowed?` key in the app-db, with associated delayed dispatch, according to my testing, it buys us nothing (it doesn't decrease number of `:load-more-messages` dispatches) and it's wrongly scoped anyway (if anything, it should be per chat and not global)\r\n* Removed the super confusing 1-arity `get-by-chat-id` realm message query function\r\n* Removed the unused `get-count-by-id`/`get-count-by-chat-id` functions not used anymore\r\n\r\nPrerequisite for #1875\r\n\r\n### Steps to test:\r\n- Open Status\r\n- Create more then 20 messages in some chat and close Status\r\n- Open Status again, go to the same chat, scroll to the very top and check if all the messages are loaded correctly.\r\n\r\n<!-- (PRs will only be accepted if squashed into single commit.) -->\r\n\r\nstatus: ready\r\n\r\n","created_at":"2017-12-06T11:58:58Z","updated_at":"2017-12-13T21:28:28Z","closed_at":"2017-12-13T21:28:27Z","merged_at":null,"merge_commit_sha":"d96740ecc7b925de6f48d3d234d116745d1b1227","assignee":{"login":"janherich","id":1910609,"avatar_url":"https://avatars1.githubusercontent.com/u/1910609?v=4","gravatar_id":"","url":"https://api.github.com/users/janherich","html_url":"https://github.com/janherich","followers_url":"https://api.github.com/users/janherich/followers","following_url":"https://api.github.com/users/janherich/following{/other_user}","gists_url":"https://api.github.com/users/janherich/gists{/gist_id}","starred_url":"https://api.github.com/users/janherich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janherich/subscriptions","organizations_url":"https://api.github.com/users/janherich/orgs","repos_url":"https://api.github.com/users/janherich/repos","events_url":"https://api.github.com/users/janherich/events{/privacy}","received_events_url":"https://api.github.com/users/janherich/received_events","type":"User","site_admin":false},"assignees":[{"login":"janherich","id":1910609,"avatar_url":"https://avatars1.githubusercontent.com/u/1910609?v=4","gravatar_id":"","url":"https://api.github.com/users/janherich","html_url":"https://github.com/janherich","followers_url":"https://api.github.com/users/janherich/followers","following_url":"https://api.github.com/users/janherich/following{/other_user}","gists_url":"https://api.github.com/users/janherich/gists{/gist_id}","starred_url":"https://api.github.com/users/janherich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janherich/subscriptions","organizations_url":"https://api.github.com/users/janherich/orgs","repos_url":"https://api.github.com/users/janherich/repos","events_url":"https://api.github.com/users/janherich/events{/privacy}","received_events_url":"https://api.github.com/users/janherich/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"alwx","id":911127,"avatar_url":"https://avatars3.githubusercontent.com/u/911127?v=4","gravatar_id":"","url":"https://api.github.com/users/alwx","html_url":"https://github.com/alwx","followers_url":"https://api.github.com/users/alwx/followers","following_url":"https://api.github.com/users/alwx/following{/other_user}","gists_url":"https://api.github.com/users/alwx/gists{/gist_id}","starred_url":"https://api.github.com/users/alwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alwx/subscriptions","organizations_url":"https://api.github.com/users/alwx/orgs","repos_url":"https://api.github.com/users/alwx/repos","events_url":"https://api.github.com/users/alwx/events{/privacy}","received_events_url":"https://api.github.com/users/alwx/received_events","type":"User","site_admin":false},{"login":"flexsurfer","id":11790366,"avatar_url":"https://avatars1.githubusercontent.com/u/11790366?v=4","gravatar_id":"","url":"https://api.github.com/users/flexsurfer","html_url":"https://github.com/flexsurfer","followers_url":"https://api.github.com/users/flexsurfer/followers","following_url":"https://api.github.com/users/flexsurfer/following{/other_user}","gists_url":"https://api.github.com/users/flexsurfer/gists{/gist_id}","starred_url":"https://api.github.com/users/flexsurfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flexsurfer/subscriptions","organizations_url":"https://api.github.com/users/flexsurfer/orgs","repos_url":"https://api.github.com/users/flexsurfer/repos","events_url":"https://api.github.com/users/flexsurfer/events{/privacy}","received_events_url":"https://api.github.com/users/flexsurfer/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/status-im/status-react/milestones/17","html_url":"https://github.com/status-im/status-react/milestone/17","labels_url":"https://api.github.com/repos/status-im/status-react/milestones/17/labels","id":2850056,"number":17,"title":"0.9.13","description":null,"creator":{"login":"oskarth","id":1552237,"avatar_url":"https://avatars2.githubusercontent.com/u/1552237?v=4","gravatar_id":"","url":"https://api.github.com/users/oskarth","html_url":"https://github.com/oskarth","followers_url":"https://api.github.com/users/oskarth/followers","following_url":"https://api.github.com/users/oskarth/following{/other_user}","gists_url":"https://api.github.com/users/oskarth/gists{/gist_id}","starred_url":"https://api.github.com/users/oskarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskarth/subscriptions","organizations_url":"https://api.github.com/users/oskarth/orgs","repos_url":"https://api.github.com/users/oskarth/repos","events_url":"https://api.github.com/users/oskarth/events{/privacy}","received_events_url":"https://api.github.com/users/oskarth/received_events","type":"User","site_admin":false},"open_issues":83,"closed_issues":72,"state":"open","created_at":"2017-10-19T08:51:49Z","updated_at":"2017-12-13T21:28:28Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/status-im/status-react/pulls/2625/commits","review_comments_url":"https://api.github.com/repos/status-im/status-react/pulls/2625/comments","review_comment_url":"https://api.github.com/repos/status-im/status-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/status-im/status-react/issues/2625/comments","statuses_url":"https://api.github.com/repos/status-im/status-react/statuses/149827976a18f415da7442480630bd0c8e7c06ea","head":{"label":"status-im:feature/simplified-message-loading-#1875","ref":"feature/simplified-message-loading-#1875","sha":"149827976a18f415da7442480630bd0c8e7c06ea","user":{"login":"status-im","id":11767950,"avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"repo":{"id":52308441,"name":"status-react","full_name":"status-im/status-react","owner":{"login":"status-im","id":11767950,"avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/status-im/status-react","description":"a free (libre) open source, mobile OS for Ethereum","fork":false,"url":"https://api.github.com/repos/status-im/status-react","forks_url":"https://api.github.com/repos/status-im/status-react/forks","keys_url":"https://api.github.com/repos/status-im/status-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/status-im/status-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/status-im/status-react/teams","hooks_url":"https://api.github.com/repos/status-im/status-react/hooks","issue_events_url":"https://api.github.com/repos/status-im/status-react/issues/events{/number}","events_url":"https://api.github.com/repos/status-im/status-react/events","assignees_url":"https://api.github.com/repos/status-im/status-react/assignees{/user}","branches_url":"https://api.github.com/repos/status-im/status-react/branches{/branch}","tags_url":"https://api.github.com/repos/status-im/status-react/tags","blobs_url":"https://api.github.com/repos/status-im/status-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/status-im/status-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/status-im/status-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/status-im/status-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/status-im/status-react/statuses/{sha}","languages_url":"https://api.github.com/repos/status-im/status-react/languages","stargazers_url":"https://api.github.com/repos/status-im/status-react/stargazers","contributors_url":"https://api.github.com/repos/status-im/status-react/contributors","subscribers_url":"https://api.github.com/repos/status-im/status-react/subscribers","subscription_url":"https://api.github.com/repos/status-im/status-react/subscription","commits_url":"https://api.github.com/repos/status-im/status-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/status-im/status-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/status-im/status-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/status-im/status-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/status-im/status-react/contents/{+path}","compare_url":"https://api.github.com/repos/status-im/status-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/status-im/status-react/merges","archive_url":"https://api.github.com/repos/status-im/status-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/status-im/status-react/downloads","issues_url":"https://api.github.com/repos/status-im/status-react/issues{/number}","pulls_url":"https://api.github.com/repos/status-im/status-react/pulls{/number}","milestones_url":"https://api.github.com/repos/status-im/status-react/milestones{/number}","notifications_url":"https://api.github.com/repos/status-im/status-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/status-im/status-react/labels{/name}","releases_url":"https://api.github.com/repos/status-im/status-react/releases{/id}","deployments_url":"https://api.github.com/repos/status-im/status-react/deployments","created_at":"2016-02-22T21:48:48Z","updated_at":"2017-12-13T18:09:20Z","pushed_at":"2017-12-13T21:18:24Z","git_url":"git://github.com/status-im/status-react.git","ssh_url":"git@github.com:status-im/status-react.git","clone_url":"https://github.com/status-im/status-react.git","svn_url":"https://github.com/status-im/status-react","homepage":"https://status.im","size":49721,"stargazers_count":1605,"watchers_count":1605,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":371,"mirror_url":null,"archived":false,"open_issues_count":447,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":371,"open_issues":447,"watchers":1605,"default_branch":"develop"}},"base":{"label":"status-im:develop","ref":"develop","sha":"1e7366be6ae4a9e9d86f950d76c6c6776d4e13f2","user":{"login":"status-im","id":11767950,"avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"repo":{"id":52308441,"name":"status-react","full_name":"status-im/status-react","owner":{"login":"status-im","id":11767950,"avatar_url":"https://avatars1.githubusercontent.com/u/11767950?v=4","gravatar_id":"","url":"https://api.github.com/users/status-im","html_url":"https://github.com/status-im","followers_url":"https://api.github.com/users/status-im/followers","following_url":"https://api.github.com/users/status-im/following{/other_user}","gists_url":"https://api.github.com/users/status-im/gists{/gist_id}","starred_url":"https://api.github.com/users/status-im/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/status-im/subscriptions","organizations_url":"https://api.github.com/users/status-im/orgs","repos_url":"https://api.github.com/users/status-im/repos","events_url":"https://api.github.com/users/status-im/events{/privacy}","received_events_url":"https://api.github.com/users/status-im/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/status-im/status-react","description":"a free (libre) open source, mobile OS for Ethereum","fork":false,"url":"https://api.github.com/repos/status-im/status-react","forks_url":"https://api.github.com/repos/status-im/status-react/forks","keys_url":"https://api.github.com/repos/status-im/status-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/status-im/status-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/status-im/status-react/teams","hooks_url":"https://api.github.com/repos/status-im/status-react/hooks","issue_events_url":"https://api.github.com/repos/status-im/status-react/issues/events{/number}","events_url":"https://api.github.com/repos/status-im/status-react/events","assignees_url":"https://api.github.com/repos/status-im/status-react/assignees{/user}","branches_url":"https://api.github.com/repos/status-im/status-react/branches{/branch}","tags_url":"https://api.github.com/repos/status-im/status-react/tags","blobs_url":"https://api.github.com/repos/status-im/status-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/status-im/status-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/status-im/status-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/status-im/status-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/status-im/status-react/statuses/{sha}","languages_url":"https://api.github.com/repos/status-im/status-react/languages","stargazers_url":"https://api.github.com/repos/status-im/status-react/stargazers","contributors_url":"https://api.github.com/repos/status-im/status-react/contributors","subscribers_url":"https://api.github.com/repos/status-im/status-react/subscribers","subscription_url":"https://api.github.com/repos/status-im/status-react/subscription","commits_url":"https://api.github.com/repos/status-im/status-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/status-im/status-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/status-im/status-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/status-im/status-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/status-im/status-react/contents/{+path}","compare_url":"https://api.github.com/repos/status-im/status-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/status-im/status-react/merges","archive_url":"https://api.github.com/repos/status-im/status-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/status-im/status-react/downloads","issues_url":"https://api.github.com/repos/status-im/status-react/issues{/number}","pulls_url":"https://api.github.com/repos/status-im/status-react/pulls{/number}","milestones_url":"https://api.github.com/repos/status-im/status-react/milestones{/number}","notifications_url":"https://api.github.com/repos/status-im/status-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/status-im/status-react/labels{/name}","releases_url":"https://api.github.com/repos/status-im/status-react/releases{/id}","deployments_url":"https://api.github.com/repos/status-im/status-react/deployments","created_at":"2016-02-22T21:48:48Z","updated_at":"2017-12-13T18:09:20Z","pushed_at":"2017-12-13T21:18:24Z","git_url":"git://github.com/status-im/status-react.git","ssh_url":"git@github.com:status-im/status-react.git","clone_url":"https://github.com/status-im/status-react.git","svn_url":"https://github.com/status-im/status-react","homepage":"https://status.im","size":49721,"stargazers_count":1605,"watchers_count":1605,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":371,"mirror_url":null,"archived":false,"open_issues_count":447,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":371,"open_issues":447,"watchers":1605,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/status-im/status-react/pulls/2625"},"html":{"href":"https://github.com/status-im/status-react/pull/2625"},"issue":{"href":"https://api.github.com/repos/status-im/status-react/issues/2625"},"comments":{"href":"https://api.github.com/repos/status-im/status-react/issues/2625/comments"},"review_comments":{"href":"https://api.github.com/repos/status-im/status-react/pulls/2625/comments"},"review_comment":{"href":"https://api.github.com/repos/status-im/status-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/status-im/status-react/pulls/2625/commits"},"statuses":{"href":"https://api.github.com/repos/status-im/status-react/statuses/149827976a18f415da7442480630bd0c8e7c06ea"}},"author_association":"MEMBER","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":2,"review_comments":4,"maintainer_can_modify":false,"commits":1,"additions":15,"deletions":34,"changed_files":5}}
{"actor":{"display_login":"janherich"}}