{"action":"created","issue":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/2769","repository_url":"https://api.github.com/repos/medic/medic-webapp","labels_url":"https://api.github.com/repos/medic/medic-webapp/issues/2769/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-webapp/issues/2769/comments","events_url":"https://api.github.com/repos/medic/medic-webapp/issues/2769/events","html_url":"https://github.com/medic/medic-webapp/issues/2769","id":178411495,"number":2769,"title":"Adding a space to a select2 search term creates a request that returns > 150MB","user":{"login":"sglangevin","id":1286381,"avatar_url":"https://avatars.githubusercontent.com/u/1286381?v=3","gravatar_id":"","url":"https://api.github.com/users/sglangevin","html_url":"https://github.com/sglangevin","followers_url":"https://api.github.com/users/sglangevin/followers","following_url":"https://api.github.com/users/sglangevin/following{/other_user}","gists_url":"https://api.github.com/users/sglangevin/gists{/gist_id}","starred_url":"https://api.github.com/users/sglangevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sglangevin/subscriptions","organizations_url":"https://api.github.com/users/sglangevin/orgs","repos_url":"https://api.github.com/users/sglangevin/repos","events_url":"https://api.github.com/users/sglangevin/events{/privacy}","received_events_url":"https://api.github.com/users/sglangevin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/medic/medic-webapp/labels/4%20-%20Acceptance%20Testing","name":"4 - Acceptance Testing","color":"fef2c0"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Bug","name":"Bug","color":"c10c02"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Performance","name":"Performance","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/medic/medic-webapp/milestones/61","html_url":"https://github.com/medic/medic-webapp/milestones/September%2019th%20-%20October%203rd","labels_url":"https://api.github.com/repos/medic/medic-webapp/milestones/61/labels","id":2008116,"number":61,"title":"September 19th - October 3rd","description":"","creator":{"login":"garethbowen","id":2064938,"avatar_url":"https://avatars.githubusercontent.com/u/2064938?v=3","gravatar_id":"","url":"https://api.github.com/users/garethbowen","html_url":"https://github.com/garethbowen","followers_url":"https://api.github.com/users/garethbowen/followers","following_url":"https://api.github.com/users/garethbowen/following{/other_user}","gists_url":"https://api.github.com/users/garethbowen/gists{/gist_id}","starred_url":"https://api.github.com/users/garethbowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethbowen/subscriptions","organizations_url":"https://api.github.com/users/garethbowen/orgs","repos_url":"https://api.github.com/users/garethbowen/repos","events_url":"https://api.github.com/users/garethbowen/events{/privacy}","received_events_url":"https://api.github.com/users/garethbowen/received_events","type":"User","site_admin":false},"open_issues":45,"closed_issues":9,"state":"open","created_at":"2016-09-15T23:54:51Z","updated_at":"2016-09-22T09:03:54Z","due_on":"2016-10-03T00:00:00Z","closed_at":null},"comments":2,"created_at":"2016-09-21T17:25:35Z","updated_at":"2016-09-22T09:36:14Z","closed_at":"2016-09-22T06:48:48Z","body":"To reproduce (make sure you have the network tab visible first):\r\n\r\n1. Go to a CHP Area\r\n2. Click Edit\r\n3. Click on the supervisor dropdown to bring up the search box\r\n4. Type in the name of a branch, then wait until you see the `contacts_by_type_freetext` view request.\r\n5. Type in a space.\r\n6. You should see a second `contacts_by_type_freetext` view request with no key. If you keep waiting (about 4 minutes in production), it will download what appears to be every contact (about 190 MB in production), and the window might freeze.\r\n\r\nCan we add in some sort of protection so that adding a space to the end of a search term can't start a whole new search (`contacts_by_type_freetext` request)? This may not fit in with how other searches work, but this can cause some annoying performance issues, including the web app freezing and search results taking a long time to be returned."},"comment":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/comments/248854902","html_url":"https://github.com/medic/medic-webapp/issues/2769#issuecomment-248854902","issue_url":"https://api.github.com/repos/medic/medic-webapp/issues/2769","id":248854902,"user":{"login":"garethbowen","id":2064938,"avatar_url":"https://avatars.githubusercontent.com/u/2064938?v=3","gravatar_id":"","url":"https://api.github.com/users/garethbowen","html_url":"https://github.com/garethbowen","followers_url":"https://api.github.com/users/garethbowen/followers","following_url":"https://api.github.com/users/garethbowen/following{/other_user}","gists_url":"https://api.github.com/users/garethbowen/gists{/gist_id}","starred_url":"https://api.github.com/users/garethbowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethbowen/subscriptions","organizations_url":"https://api.github.com/users/garethbowen/orgs","repos_url":"https://api.github.com/users/garethbowen/repos","events_url":"https://api.github.com/users/garethbowen/events{/privacy}","received_events_url":"https://api.github.com/users/garethbowen/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T09:36:14Z","updated_at":"2016-09-22T09:36:14Z","body":"@alxndrsn Currently for administrators we only search when 3 characters are provided, but that is controlled by select2 and without patching it we can't do a trim first. We could short circuit in the Search service itself but I couldn't think of a nice way to communicate back to the user that their term wasn't long enough, because again, the rendering is handled by select2. So admittedly this is a less than perfect solution but it gets rid of some simple edge cases before we get server side searching done."}}
{"actor":{"display_login":"garethbowen"}}