{"action":"created","issue":{"url":"https://api.github.com/repos/basecamp/trix/issues/350","repository_url":"https://api.github.com/repos/basecamp/trix","labels_url":"https://api.github.com/repos/basecamp/trix/issues/350/labels{/name}","comments_url":"https://api.github.com/repos/basecamp/trix/issues/350/comments","events_url":"https://api.github.com/repos/basecamp/trix/issues/350/events","html_url":"https://github.com/basecamp/trix/issues/350","id":192098276,"number":350,"title":"Excessive requests to image attachment \"preview\" URL","user":{"login":"spdawson","id":132732,"avatar_url":"https://avatars.githubusercontent.com/u/132732?v=3","gravatar_id":"","url":"https://api.github.com/users/spdawson","html_url":"https://github.com/spdawson","followers_url":"https://api.github.com/users/spdawson/followers","following_url":"https://api.github.com/users/spdawson/following{/other_user}","gists_url":"https://api.github.com/users/spdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/spdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spdawson/subscriptions","organizations_url":"https://api.github.com/users/spdawson/orgs","repos_url":"https://api.github.com/users/spdawson/repos","events_url":"https://api.github.com/users/spdawson/events{/privacy}","received_events_url":"https://api.github.com/users/spdawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-28T19:40:40Z","updated_at":"2016-11-28T20:01:39Z","closed_at":null,"body":"When editing a previously-saved document, containing an image attachment, the attachment \"preview\" URL is requested for each keypress event.\r\n\r\nIs this correct expected behaviour? I can understand that Trix needs to keep the attachment previews up-to-date, but doing so on each keypress event seems excessive...\r\n\r\n##### Steps to Reproduce\r\n\r\n1. Create a document\r\n2. Attach an image\r\n3. Save\r\n4. Edit the document\r\n5. Observe that each editor keypress event causes a request to the image \"preview\" URL\r\n\r\n##### Details\r\n\r\n* Trix version: 0.9.10\r\n* Browser name and version: Chromium 53.0.2785.143\r\n* Operating system: Ubuntu Linux 16.04.1\r\n"},"comment":{"url":"https://api.github.com/repos/basecamp/trix/issues/comments/263377828","html_url":"https://github.com/basecamp/trix/issues/350#issuecomment-263377828","issue_url":"https://api.github.com/repos/basecamp/trix/issues/350","id":263377828,"user":{"login":"javan","id":5355,"avatar_url":"https://avatars.githubusercontent.com/u/5355?v=3","gravatar_id":"","url":"https://api.github.com/users/javan","html_url":"https://github.com/javan","followers_url":"https://api.github.com/users/javan/followers","following_url":"https://api.github.com/users/javan/following{/other_user}","gists_url":"https://api.github.com/users/javan/gists{/gist_id}","starred_url":"https://api.github.com/users/javan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javan/subscriptions","organizations_url":"https://api.github.com/users/javan/orgs","repos_url":"https://api.github.com/users/javan/repos","events_url":"https://api.github.com/users/javan/events{/privacy}","received_events_url":"https://api.github.com/users/javan/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T20:01:39Z","updated_at":"2016-11-28T20:01:39Z","body":"No, that's not the intended behavior. Trix recycles `<img>` elements ([identified by their `data-trix-store-key`](https://github.com/basecamp/trix/blob/master/src/trix/views/document_view.coffee#L55-L57)) to avoid reloading them. Can you share the document you're editing or a sample document that reproduces the issue?"}}
{"actor":{"display_login":"javan"}}