{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium-base-driver/pulls/comments/38114517","id":38114517,"diff_hunk":"@@ -184,8 +194,29 @@ class BaseDriver extends MobileJsonWireProtocol {\n \n     if (!_.contains(validStrats, strategy)) {\n       throw new errors.InvalidSelectorError(`Locator Strategy \"${strategy}\" is not supported for this session`);\n+    }\n+  }\n+\n+  /*\n+   * Restart the session with the original caps,\n+   * preserving the timeout config.\n+   */\n+  async reset () {\n+    log.debug(\"Resetting app mid-session\");\n+    log.debug(\"Running generic full reset\");\n+    let currentConfig = {};\n+    for (let k of ['implicitWaitMs', 'newCommandTimeoutMs', 'sessionId']) {\n+      currentConfig[k] = this[k];\n+    }\n+    await this.deleteSession();\n+    log.debug(\"Restarting app\");\n+    await this.createSession(this.caps);\n+\n+    for (let [k,v] of _.pairs(currentConfig)) {\n+      this[k] = v;","path":"lib/driver.js","position":108,"original_position":108,"commit_id":"98fdbfda22e98d7e4712743f9f83a2458bf6d20b","original_commit_id":"98fdbfda22e98d7e4712743f9f83a2458bf6d20b","user":{"login":"jlipps","id":605053,"avatar_url":"https://avatars.githubusercontent.com/u/605053?v=3","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},"body":"I'm down with that idea. so we'd do what I just suggested and allow `createSession` to take a sessionId parameter so it doesn't make its own.","created_at":"2015-08-27T16:16:58Z","updated_at":"2015-08-27T16:16:58Z","html_url":"https://github.com/appium/appium-base-driver/pull/17#discussion_r38114517","pull_request_url":"https://api.github.com/repos/appium/appium-base-driver/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/appium/appium-base-driver/pulls/comments/38114517"},"html":{"href":"https://github.com/appium/appium-base-driver/pull/17#discussion_r38114517"},"pull_request":{"href":"https://api.github.com/repos/appium/appium-base-driver/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium-base-driver/pulls/17","id":43380904,"html_url":"https://github.com/appium/appium-base-driver/pull/17","diff_url":"https://github.com/appium/appium-base-driver/pull/17.diff","patch_url":"https://github.com/appium/appium-base-driver/pull/17.patch","issue_url":"https://api.github.com/repos/appium/appium-base-driver/issues/17","number":17,"state":"open","locked":false,"title":"Adds reset + command timeout improvements","user":{"login":"sebv","id":418288,"avatar_url":"https://avatars.githubusercontent.com/u/418288?v=3","gravatar_id":"","url":"https://api.github.com/users/sebv","html_url":"https://github.com/sebv","followers_url":"https://api.github.com/users/sebv/followers","following_url":"https://api.github.com/users/sebv/following{/other_user}","gists_url":"https://api.github.com/users/sebv/gists{/gist_id}","starred_url":"https://api.github.com/users/sebv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebv/subscriptions","organizations_url":"https://api.github.com/users/sebv/orgs","repos_url":"https://api.github.com/users/sebv/repos","events_url":"https://api.github.com/users/sebv/events{/privacy}","received_events_url":"https://api.github.com/users/sebv/received_events","type":"User","site_admin":false},"body":"I think it is enough for iOS, so much simpler. ping @jlipps @moizjv \r\n\r\nAndroid has extra logic (or use different) on top of that, I'll let Moiz figure it out. ","created_at":"2015-08-26T09:24:32Z","updated_at":"2015-08-27T16:16:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afcb419495a514ed91e6533a9514d06fa9d56cd6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium-base-driver/pulls/17/commits","review_comments_url":"https://api.github.com/repos/appium/appium-base-driver/pulls/17/comments","review_comment_url":"https://api.github.com/repos/appium/appium-base-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appium/appium-base-driver/issues/17/comments","statuses_url":"https://api.github.com/repos/appium/appium-base-driver/statuses/98fdbfda22e98d7e4712743f9f83a2458bf6d20b","head":{"label":"appium:sebv-reset","ref":"sebv-reset","sha":"98fdbfda22e98d7e4712743f9f83a2458bf6d20b","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":35977087,"name":"appium-base-driver","full_name":"appium/appium-base-driver","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-base-driver","description":"Base class for an Appium driver","fork":false,"url":"https://api.github.com/repos/appium/appium-base-driver","forks_url":"https://api.github.com/repos/appium/appium-base-driver/forks","keys_url":"https://api.github.com/repos/appium/appium-base-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-base-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-base-driver/teams","hooks_url":"https://api.github.com/repos/appium/appium-base-driver/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-base-driver/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-base-driver/events","assignees_url":"https://api.github.com/repos/appium/appium-base-driver/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-base-driver/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-base-driver/tags","blobs_url":"https://api.github.com/repos/appium/appium-base-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-base-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-base-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-base-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-base-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-base-driver/languages","stargazers_url":"https://api.github.com/repos/appium/appium-base-driver/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-base-driver/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-base-driver/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-base-driver/subscription","commits_url":"https://api.github.com/repos/appium/appium-base-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-base-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-base-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-base-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-base-driver/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-base-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-base-driver/merges","archive_url":"https://api.github.com/repos/appium/appium-base-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-base-driver/downloads","issues_url":"https://api.github.com/repos/appium/appium-base-driver/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-base-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-base-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-base-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-base-driver/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-base-driver/releases{/id}","created_at":"2015-05-20T22:15:40Z","updated_at":"2015-08-20T21:33:54Z","pushed_at":"2015-08-27T09:43:23Z","git_url":"git://github.com/appium/appium-base-driver.git","ssh_url":"git@github.com:appium/appium-base-driver.git","clone_url":"https://github.com/appium/appium-base-driver.git","svn_url":"https://github.com/appium/appium-base-driver","homepage":null,"size":647,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":3,"default_branch":"master"}},"base":{"label":"appium:master","ref":"master","sha":"7120f4c75d2d59b82d78fcc842c69619a5d37c05","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":35977087,"name":"appium-base-driver","full_name":"appium/appium-base-driver","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-base-driver","description":"Base class for an Appium driver","fork":false,"url":"https://api.github.com/repos/appium/appium-base-driver","forks_url":"https://api.github.com/repos/appium/appium-base-driver/forks","keys_url":"https://api.github.com/repos/appium/appium-base-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-base-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-base-driver/teams","hooks_url":"https://api.github.com/repos/appium/appium-base-driver/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-base-driver/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-base-driver/events","assignees_url":"https://api.github.com/repos/appium/appium-base-driver/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-base-driver/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-base-driver/tags","blobs_url":"https://api.github.com/repos/appium/appium-base-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-base-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-base-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-base-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-base-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-base-driver/languages","stargazers_url":"https://api.github.com/repos/appium/appium-base-driver/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-base-driver/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-base-driver/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-base-driver/subscription","commits_url":"https://api.github.com/repos/appium/appium-base-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-base-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-base-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-base-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-base-driver/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-base-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-base-driver/merges","archive_url":"https://api.github.com/repos/appium/appium-base-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-base-driver/downloads","issues_url":"https://api.github.com/repos/appium/appium-base-driver/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-base-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-base-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-base-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-base-driver/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-base-driver/releases{/id}","created_at":"2015-05-20T22:15:40Z","updated_at":"2015-08-20T21:33:54Z","pushed_at":"2015-08-27T09:43:23Z","git_url":"git://github.com/appium/appium-base-driver.git","ssh_url":"git@github.com:appium/appium-base-driver.git","clone_url":"https://github.com/appium/appium-base-driver.git","svn_url":"https://github.com/appium/appium-base-driver","homepage":null,"size":647,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium-base-driver/pulls/17"},"html":{"href":"https://github.com/appium/appium-base-driver/pull/17"},"issue":{"href":"https://api.github.com/repos/appium/appium-base-driver/issues/17"},"comments":{"href":"https://api.github.com/repos/appium/appium-base-driver/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium-base-driver/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/appium/appium-base-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appium/appium-base-driver/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium-base-driver/statuses/98fdbfda22e98d7e4712743f9f83a2458bf6d20b"}}}}