GitHub PullRequestReviewCommentEvent at 2014-10-30 17:30:50
Repository: brackets
Actor: peterflynn
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/adobe/brackets/pulls/comments/19621224","id":19621224,"diff_hunk":"@@ -944,38 +929,16 @@ define(function (require, exports, module) {\n \n     /**\n      * Refresh the project's file tree, maintaining the current selection.\n-     *\n-     * @return {$.Promise} A promise object that will be resolved when the\n-     *  project tree is reloaded, or rejected if the project path\n-     *  fails to reload. If the previous selected entry is not found,\n-     *  the promise is still resolved.\n+     * \n+     * Note that the original implementation of this returned a promise to be resolved when the refresh is complete.\n+     * That use is deprecated and `refreshFileTree` is now a \"fire and forget\" kind of function.\n      */\n-    function refreshFileTree() {\n-        if (!_refreshFileTreePromise) {\n-            var internalRefreshPromise  = model.refresh(),\n-                deferred                = new $.Deferred();\n-\n-            _refreshFileTreePromise = deferred.promise();\n-\n-            _refreshFileTreePromise.always(function () {\n-                _refreshFileTreePromise = null;\n-\n-                if (_refreshPending) {\n-                    _refreshPending = false;\n-                    refreshFileTree();\n-                }\n-            });\n-\n-            // Wait at least one second before resolving the promise\n-            window.setTimeout(function () {\n-                internalRefreshPromise.then(deferred.resolve, deferred.reject);\n-            }, _refreshDelay);\n-        } else {\n-            _refreshPending = true;\n-        }\n-\n-        return _refreshFileTreePromise;\n-    }\n+    var refreshFileTree = function refreshFileTree() {\n+        FileSystem.clearAllCaches();\n+        return new $.Deferred().resolve().promise();\n+    };\n+    \n+    refreshFileTree = _.debounce(refreshFileTree, _refreshDelay);","path":"src/project/ProjectManager.js","position":66,"original_position":66,"commit_id":"c6a2f463df6ed1819b74bb1a3566e612e9e0fafd","original_commit_id":"c6a2f463df6ed1819b74bb1a3566e612e9e0fafd","user":{"login":"peterflynn","id":1197510,"avatar_url":"https://avatars.githubusercontent.com/u/1197510?v=2","gravatar_id":"","url":"https://api.github.com/users/peterflynn","html_url":"https://github.com/peterflynn","followers_url":"https://api.github.com/users/peterflynn/followers","following_url":"https://api.github.com/users/peterflynn/following{/other_user}","gists_url":"https://api.github.com/users/peterflynn/gists{/gist_id}","starred_url":"https://api.github.com/users/peterflynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterflynn/subscriptions","organizations_url":"https://api.github.com/users/peterflynn/orgs","repos_url":"https://api.github.com/users/peterflynn/repos","events_url":"https://api.github.com/users/peterflynn/events{/privacy}","received_events_url":"https://api.github.com/users/peterflynn/received_events","type":"User","site_admin":false},"body":"This seems fine, but fwiw I think the intent of the original code (pre-React refactoring) was to apply the debounce to FS-event-driven refreshes... which would imply this debounce & re-entrancy guard should go onto `ProjectModel.refresh()`, ideally.  Not something we need to change now, though :-)","created_at":"2014-10-30T17:30:50Z","updated_at":"2014-10-30T17:30:50Z","html_url":"https://github.com/adobe/brackets/pull/9735#discussion_r19621224","pull_request_url":"https://api.github.com/repos/adobe/brackets/pulls/9735","_links":{"self":{"href":"https://api.github.com/repos/adobe/brackets/pulls/comments/19621224"},"html":{"href":"https://github.com/adobe/brackets/pull/9735#discussion_r19621224"},"pull_request":{"href":"https://api.github.com/repos/adobe/brackets/pulls/9735"}}},"pull_request":{"url":"https://api.github.com/repos/adobe/brackets/pulls/9735","id":23535079,"html_url":"https://github.com/adobe/brackets/pull/9735","diff_url":"https://github.com/adobe/brackets/pull/9735.diff","patch_url":"https://github.com/adobe/brackets/pull/9735.patch","issue_url":"https://api.github.com/repos/adobe/brackets/issues/9735","number":9735,"state":"open","locked":false,"title":"Make the Refresh File Tree command clear caches","user":{"login":"dangoor","id":55970,"avatar_url":"https://avatars.githubusercontent.com/u/55970?v=2","gravatar_id":"","url":"https://api.github.com/users/dangoor","html_url":"https://github.com/dangoor","followers_url":"https://api.github.com/users/dangoor/followers","following_url":"https://api.github.com/users/dangoor/following{/other_user}","gists_url":"https://api.github.com/users/dangoor/gists{/gist_id}","starred_url":"https://api.github.com/users/dangoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangoor/subscriptions","organizations_url":"https://api.github.com/users/dangoor/orgs","repos_url":"https://api.github.com/users/dangoor/repos","events_url":"https://api.github.com/users/dangoor/events{/privacy}","received_events_url":"https://api.github.com/users/dangoor/received_events","type":"User","site_admin":false},"body":"This ensures a full refresh.\r\n\r\nAs suggested in #7929.","created_at":"2014-10-29T14:44:14Z","updated_at":"2014-10-30T17:30:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67ce68200cac76548c6bb5809ad6a4cb88fda344","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adobe/brackets/pulls/9735/commits","review_comments_url":"https://api.github.com/repos/adobe/brackets/pulls/9735/comments","review_comment_url":"https://api.github.com/repos/adobe/brackets/pulls/comments/{number}","comments_url":"https://api.github.com/repos/adobe/brackets/issues/9735/comments","statuses_url":"https://api.github.com/repos/adobe/brackets/statuses/c6a2f463df6ed1819b74bb1a3566e612e9e0fafd","head":{"label":"adobe:dangoor/true-refresh","ref":"dangoor/true-refresh","sha":"c6a2f463df6ed1819b74bb1a3566e612e9e0fafd","user":{"login":"adobe","id":476009,"avatar_url":"https://avatars.githubusercontent.com/u/476009?v=2","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"repo":{"id":2935735,"name":"brackets","full_name":"adobe/brackets","owner":{"login":"adobe","id":476009,"avatar_url":"https://avatars.githubusercontent.com/u/476009?v=2","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe/brackets","description":"An open source code editor for the web, written in JavaScript, HTML and CSS.","fork":false,"url":"https://api.github.com/repos/adobe/brackets","forks_url":"https://api.github.com/repos/adobe/brackets/forks","keys_url":"https://api.github.com/repos/adobe/brackets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe/brackets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe/brackets/teams","hooks_url":"https://api.github.com/repos/adobe/brackets/hooks","issue_events_url":"https://api.github.com/repos/adobe/brackets/issues/events{/number}","events_url":"https://api.github.com/repos/adobe/brackets/events","assignees_url":"https://api.github.com/repos/adobe/brackets/assignees{/user}","branches_url":"https://api.github.com/repos/adobe/brackets/branches{/branch}","tags_url":"https://api.github.com/repos/adobe/brackets/tags","blobs_url":"https://api.github.com/repos/adobe/brackets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe/brackets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe/brackets/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe/brackets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe/brackets/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe/brackets/languages","stargazers_url":"https://api.github.com/repos/adobe/brackets/stargazers","contributors_url":"https://api.github.com/repos/adobe/brackets/contributors","subscribers_url":"https://api.github.com/repos/adobe/brackets/subscribers","subscription_url":"https://api.github.com/repos/adobe/brackets/subscription","commits_url":"https://api.github.com/repos/adobe/brackets/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe/brackets/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe/brackets/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe/brackets/issues/comments/{number}","contents_url":"https://api.github.com/repos/adobe/brackets/contents/{+path}","compare_url":"https://api.github.com/repos/adobe/brackets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe/brackets/merges","archive_url":"https://api.github.com/repos/adobe/brackets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe/brackets/downloads","issues_url":"https://api.github.com/repos/adobe/brackets/issues{/number}","pulls_url":"https://api.github.com/repos/adobe/brackets/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe/brackets/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe/brackets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe/brackets/labels{/name}","releases_url":"https://api.github.com/repos/adobe/brackets/releases{/id}","created_at":"2011-12-07T21:14:40Z","updated_at":"2014-10-30T17:17:38Z","pushed_at":"2014-10-30T16:22:05Z","git_url":"git://github.com/adobe/brackets.git","ssh_url":"git@github.com:adobe/brackets.git","clone_url":"https://github.com/adobe/brackets.git","svn_url":"https://github.com/adobe/brackets","homepage":"http://brackets.io","size":370730,"stargazers_count":18534,"watchers_count":18534,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3829,"mirror_url":null,"open_issues_count":1010,"forks":3829,"open_issues":1010,"watchers":18534,"default_branch":"master"}},"base":{"label":"adobe:master","ref":"master","sha":"5800d7d5ba02cf1e28bfdbd2f1cf1cb1852a2801","user":{"login":"adobe","id":476009,"avatar_url":"https://avatars.githubusercontent.com/u/476009?v=2","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"repo":{"id":2935735,"name":"brackets","full_name":"adobe/brackets","owner":{"login":"adobe","id":476009,"avatar_url":"https://avatars.githubusercontent.com/u/476009?v=2","gravatar_id":"","url":"https://api.github.com/users/adobe","html_url":"https://github.com/adobe","followers_url":"https://api.github.com/users/adobe/followers","following_url":"https://api.github.com/users/adobe/following{/other_user}","gists_url":"https://api.github.com/users/adobe/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe/subscriptions","organizations_url":"https://api.github.com/users/adobe/orgs","repos_url":"https://api.github.com/users/adobe/repos","events_url":"https://api.github.com/users/adobe/events{/privacy}","received_events_url":"https://api.github.com/users/adobe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe/brackets","description":"An open source code editor for the web, written in JavaScript, HTML and CSS.","fork":false,"url":"https://api.github.com/repos/adobe/brackets","forks_url":"https://api.github.com/repos/adobe/brackets/forks","keys_url":"https://api.github.com/repos/adobe/brackets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe/brackets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe/brackets/teams","hooks_url":"https://api.github.com/repos/adobe/brackets/hooks","issue_events_url":"https://api.github.com/repos/adobe/brackets/issues/events{/number}","events_url":"https://api.github.com/repos/adobe/brackets/events","assignees_url":"https://api.github.com/repos/adobe/brackets/assignees{/user}","branches_url":"https://api.github.com/repos/adobe/brackets/branches{/branch}","tags_url":"https://api.github.com/repos/adobe/brackets/tags","blobs_url":"https://api.github.com/repos/adobe/brackets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe/brackets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe/brackets/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe/brackets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe/brackets/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe/brackets/languages","stargazers_url":"https://api.github.com/repos/adobe/brackets/stargazers","contributors_url":"https://api.github.com/repos/adobe/brackets/contributors","subscribers_url":"https://api.github.com/repos/adobe/brackets/subscribers","subscription_url":"https://api.github.com/repos/adobe/brackets/subscription","commits_url":"https://api.github.com/repos/adobe/brackets/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe/brackets/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe/brackets/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe/brackets/issues/comments/{number}","contents_url":"https://api.github.com/repos/adobe/brackets/contents/{+path}","compare_url":"https://api.github.com/repos/adobe/brackets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe/brackets/merges","archive_url":"https://api.github.com/repos/adobe/brackets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe/brackets/downloads","issues_url":"https://api.github.com/repos/adobe/brackets/issues{/number}","pulls_url":"https://api.github.com/repos/adobe/brackets/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe/brackets/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe/brackets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe/brackets/labels{/name}","releases_url":"https://api.github.com/repos/adobe/brackets/releases{/id}","created_at":"2011-12-07T21:14:40Z","updated_at":"2014-10-30T17:17:38Z","pushed_at":"2014-10-30T16:22:05Z","git_url":"git://github.com/adobe/brackets.git","ssh_url":"git@github.com:adobe/brackets.git","clone_url":"https://github.com/adobe/brackets.git","svn_url":"https://github.com/adobe/brackets","homepage":"http://brackets.io","size":370730,"stargazers_count":18534,"watchers_count":18534,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3829,"mirror_url":null,"open_issues_count":1010,"forks":3829,"open_issues":1010,"watchers":18534,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adobe/brackets/pulls/9735"},"html":{"href":"https://github.com/adobe/brackets/pull/9735"},"issue":{"href":"https://api.github.com/repos/adobe/brackets/issues/9735"},"comments":{"href":"https://api.github.com/repos/adobe/brackets/issues/9735/comments"},"review_comments":{"href":"https://api.github.com/repos/adobe/brackets/pulls/9735/comments"},"review_comment":{"href":"https://api.github.com/repos/adobe/brackets/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/adobe/brackets/pulls/9735/commits"},"statuses":{"href":"https://api.github.com/repos/adobe/brackets/statuses/c6a2f463df6ed1819b74bb1a3566e612e9e0fafd"}}}}