{"action":"created","issue":{"url":"https://api.github.com/repos/aristath/edd-remote-installer/issues/5","repository_url":"https://api.github.com/repos/aristath/edd-remote-installer","labels_url":"https://api.github.com/repos/aristath/edd-remote-installer/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/aristath/edd-remote-installer/issues/5/comments","events_url":"https://api.github.com/repos/aristath/edd-remote-installer/issues/5/events","html_url":"https://github.com/aristath/edd-remote-installer/issues/5","id":137719414,"number":5,"title":"Double firing of AJAX","user":{"login":"thefrosty","id":367897,"avatar_url":"https://avatars.githubusercontent.com/u/367897?v=3","gravatar_id":"","url":"https://api.github.com/users/thefrosty","html_url":"https://github.com/thefrosty","followers_url":"https://api.github.com/users/thefrosty/followers","following_url":"https://api.github.com/users/thefrosty/following{/other_user}","gists_url":"https://api.github.com/users/thefrosty/gists{/gist_id}","starred_url":"https://api.github.com/users/thefrosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefrosty/subscriptions","organizations_url":"https://api.github.com/users/thefrosty/orgs","repos_url":"https://api.github.com/users/thefrosty/repos","events_url":"https://api.github.com/users/thefrosty/events{/privacy}","received_events_url":"https://api.github.com/users/thefrosty/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aristath/edd-remote-installer/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"thefrosty","id":367897,"avatar_url":"https://avatars.githubusercontent.com/u/367897?v=3","gravatar_id":"","url":"https://api.github.com/users/thefrosty","html_url":"https://github.com/thefrosty","followers_url":"https://api.github.com/users/thefrosty/followers","following_url":"https://api.github.com/users/thefrosty/following{/other_user}","gists_url":"https://api.github.com/users/thefrosty/gists{/gist_id}","starred_url":"https://api.github.com/users/thefrosty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefrosty/subscriptions","organizations_url":"https://api.github.com/users/thefrosty/orgs","repos_url":"https://api.github.com/users/thefrosty/repos","events_url":"https://api.github.com/users/thefrosty/events{/privacy}","received_events_url":"https://api.github.com/users/thefrosty/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-03-01T23:25:22Z","updated_at":"2016-03-02T00:48:14Z","closed_at":null,"body":"When submitting a license request the is returned the first time multiple requests could happen.\r\n\r\nThis also could happen if you click the install button then exit the thickbox modal and click install on a separate download. Thinking an AJAX modal is needed or generated inline of each download."},"comment":{"url":"https://api.github.com/repos/aristath/edd-remote-installer/issues/comments/190995425","html_url":"https://github.com/aristath/edd-remote-installer/issues/5#issuecomment-190995425","issue_url":"https://api.github.com/repos/aristath/edd-remote-installer/issues/5","id":190995425,"user":{"login":"aristath","id":588688,"avatar_url":"https://avatars.githubusercontent.com/u/588688?v=3","gravatar_id":"","url":"https://api.github.com/users/aristath","html_url":"https://github.com/aristath","followers_url":"https://api.github.com/users/aristath/followers","following_url":"https://api.github.com/users/aristath/following{/other_user}","gists_url":"https://api.github.com/users/aristath/gists{/gist_id}","starred_url":"https://api.github.com/users/aristath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aristath/subscriptions","organizations_url":"https://api.github.com/users/aristath/orgs","repos_url":"https://api.github.com/users/aristath/repos","events_url":"https://api.github.com/users/aristath/events{/privacy}","received_events_url":"https://api.github.com/users/aristath/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T00:48:14Z","updated_at":"2016-03-02T00:48:14Z","body":"What if we did something like this:\r\n\r\n```php\r\n// set our transient name here\r\n$transient_name = 'my_updater_running_tasks';\r\n// Get any current tasks.\r\n// returns false if none are set.\r\n$current_tasks = get_transient( $transient_name );\r\n$current_tasks = ( false === $current_tasks ) ? array() : $current_tasks;\r\n// This is the task we want to add.\r\n// $id is the product-if for example\r\n// $args are whatever we need.\r\n$new_task = array(\r\n    $id => $args,\r\n);\r\n// merge the arrays\r\n$tasks = wp_parse_args( $new_task, $current_tasks );\r\n// update transient if needed\r\nif ( $current_tasks != $tasks ) {\r\n\tset_transient( $transient_name, $tasks, 600 );\r\n}\r\n```\r\n\r\nThen we can check the value of the transient and no duplicate tasks will be contained there... no matter what users do"}}