{"action":"created","comment":{"url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/comments/75065785","id":75065785,"diff_hunk":"@@ -40,5 +40,36 @@ import UIKit\n         let certificatePath = NSBundle.mainBundle().pathForResource(sharedAppDelegate.bridgeInfo.certificateName, ofType: \"pem\")\n         return certificatePath\n     }\n+    \n+    class func encryptedDataFilename() -> String {\n+        return \"encrypted.zip\"\n+    }\n+    \n+    class func encryptedDataPathRoot() -> String {\n+        return NSTemporaryDirectory()\n+    }\n+    \n+    public class func encryptedFilesAwaitingUploadResponse() -> [String] {\n+        let tmpDir = encryptedDataPathRoot()\n+        let fileMan = NSFileManager.defaultManager()\n+        \n+        let tmpContents = fileMan.subpathsAtPath(tmpDir)\n+        let filesOfInterest = tmpContents?.mapAndFilter({ (file) -> String? in\n+            if (file as NSString).lastPathComponent != encryptedDataFilename() { return nil }","path":"BridgeAppSDK/DataArchiving/SBAEncryptionHelper.swift","position":19,"original_position":19,"commit_id":"b8ebbd47b8d75207420c25b8752bb3511d4b35cf","original_commit_id":"b8ebbd47b8d75207420c25b8752bb3511d4b35cf","user":{"login":"syoung-smallwisdom","id":5649217,"avatar_url":"https://avatars.githubusercontent.com/u/5649217?v=3","gravatar_id":"","url":"https://api.github.com/users/syoung-smallwisdom","html_url":"https://github.com/syoung-smallwisdom","followers_url":"https://api.github.com/users/syoung-smallwisdom/followers","following_url":"https://api.github.com/users/syoung-smallwisdom/following{/other_user}","gists_url":"https://api.github.com/users/syoung-smallwisdom/gists{/gist_id}","starred_url":"https://api.github.com/users/syoung-smallwisdom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syoung-smallwisdom/subscriptions","organizations_url":"https://api.github.com/users/syoung-smallwisdom/orgs","repos_url":"https://api.github.com/users/syoung-smallwisdom/repos","events_url":"https://api.github.com/users/syoung-smallwisdom/events{/privacy}","received_events_url":"https://api.github.com/users/syoung-smallwisdom/received_events","type":"User","site_admin":false},"body":"`guard (file as NSString).lastPathComponent == encryptedDataFilename() else { return nil }`\r\n\r\nI've been trying to use the `guard` for early exits since this seems to be the Apple-preferred pattern.","created_at":"2016-08-17T05:53:56Z","updated_at":"2016-08-17T05:53:56Z","html_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK/pull/90#discussion_r75065785","pull_request_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/comments/75065785"},"html":{"href":"https://github.com/Sage-Bionetworks/BridgeAppSDK/pull/90#discussion_r75065785"},"pull_request":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90","id":81580737,"html_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK/pull/90","diff_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK/pull/90.diff","patch_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK/pull/90.patch","issue_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues/90","number":90,"state":"open","locked":false,"title":"Orphaned tmp files patch","user":{"login":"Erin-Mounts","id":952606,"avatar_url":"https://avatars.githubusercontent.com/u/952606?v=3","gravatar_id":"","url":"https://api.github.com/users/Erin-Mounts","html_url":"https://github.com/Erin-Mounts","followers_url":"https://api.github.com/users/Erin-Mounts/followers","following_url":"https://api.github.com/users/Erin-Mounts/following{/other_user}","gists_url":"https://api.github.com/users/Erin-Mounts/gists{/gist_id}","starred_url":"https://api.github.com/users/Erin-Mounts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Erin-Mounts/subscriptions","organizations_url":"https://api.github.com/users/Erin-Mounts/orgs","repos_url":"https://api.github.com/users/Erin-Mounts/repos","events_url":"https://api.github.com/users/Erin-Mounts/events{/privacy}","received_events_url":"https://api.github.com/users/Erin-Mounts/received_events","type":"User","site_admin":false},"body":"requires https://github.com/Sage-Bionetworks/Bridge-iOS-SDK/pull/89","created_at":"2016-08-17T03:55:10Z","updated_at":"2016-08-17T05:53:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86089261966001fcf4ffb87601194810b892ff07","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90/commits","review_comments_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90/comments","review_comment_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues/90/comments","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/statuses/b8ebbd47b8d75207420c25b8752bb3511d4b35cf","head":{"label":"Erin-Mounts:orphaned-tmp-files-patch","ref":"orphaned-tmp-files-patch","sha":"b8ebbd47b8d75207420c25b8752bb3511d4b35cf","user":{"login":"Erin-Mounts","id":952606,"avatar_url":"https://avatars.githubusercontent.com/u/952606?v=3","gravatar_id":"","url":"https://api.github.com/users/Erin-Mounts","html_url":"https://github.com/Erin-Mounts","followers_url":"https://api.github.com/users/Erin-Mounts/followers","following_url":"https://api.github.com/users/Erin-Mounts/following{/other_user}","gists_url":"https://api.github.com/users/Erin-Mounts/gists{/gist_id}","starred_url":"https://api.github.com/users/Erin-Mounts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Erin-Mounts/subscriptions","organizations_url":"https://api.github.com/users/Erin-Mounts/orgs","repos_url":"https://api.github.com/users/Erin-Mounts/repos","events_url":"https://api.github.com/users/Erin-Mounts/events{/privacy}","received_events_url":"https://api.github.com/users/Erin-Mounts/received_events","type":"User","site_admin":false},"repo":{"id":52571243,"name":"BridgeAppSDK","full_name":"Erin-Mounts/BridgeAppSDK","owner":{"login":"Erin-Mounts","id":952606,"avatar_url":"https://avatars.githubusercontent.com/u/952606?v=3","gravatar_id":"","url":"https://api.github.com/users/Erin-Mounts","html_url":"https://github.com/Erin-Mounts","followers_url":"https://api.github.com/users/Erin-Mounts/followers","following_url":"https://api.github.com/users/Erin-Mounts/following{/other_user}","gists_url":"https://api.github.com/users/Erin-Mounts/gists{/gist_id}","starred_url":"https://api.github.com/users/Erin-Mounts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Erin-Mounts/subscriptions","organizations_url":"https://api.github.com/users/Erin-Mounts/orgs","repos_url":"https://api.github.com/users/Erin-Mounts/repos","events_url":"https://api.github.com/users/Erin-Mounts/events{/privacy}","received_events_url":"https://api.github.com/users/Erin-Mounts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Erin-Mounts/BridgeAppSDK","description":"SDK for creating ResearchKit-based Bridge apps for iOS","fork":true,"url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK","forks_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/forks","keys_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/teams","hooks_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/hooks","issue_events_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/issues/events{/number}","events_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/events","assignees_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/assignees{/user}","branches_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/branches{/branch}","tags_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/tags","blobs_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/languages","stargazers_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/stargazers","contributors_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/contributors","subscribers_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/subscribers","subscription_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/subscription","commits_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/contents/{+path}","compare_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/merges","archive_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/downloads","issues_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/issues{/number}","pulls_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/labels{/name}","releases_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/releases{/id}","deployments_url":"https://api.github.com/repos/Erin-Mounts/BridgeAppSDK/deployments","created_at":"2016-02-26T02:03:14Z","updated_at":"2016-02-26T02:03:15Z","pushed_at":"2016-08-17T03:57:02Z","git_url":"git://github.com/Erin-Mounts/BridgeAppSDK.git","ssh_url":"git@github.com:Erin-Mounts/BridgeAppSDK.git","clone_url":"https://github.com/Erin-Mounts/BridgeAppSDK.git","svn_url":"https://github.com/Erin-Mounts/BridgeAppSDK","homepage":null,"size":904,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Sage-Bionetworks:master","ref":"master","sha":"6add3e167f9d68d5a00301b075b1f85a3abd0b4a","user":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars.githubusercontent.com/u/1250897?v=3","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"repo":{"id":51097924,"name":"BridgeAppSDK","full_name":"Sage-Bionetworks/BridgeAppSDK","owner":{"login":"Sage-Bionetworks","id":1250897,"avatar_url":"https://avatars.githubusercontent.com/u/1250897?v=3","gravatar_id":"","url":"https://api.github.com/users/Sage-Bionetworks","html_url":"https://github.com/Sage-Bionetworks","followers_url":"https://api.github.com/users/Sage-Bionetworks/followers","following_url":"https://api.github.com/users/Sage-Bionetworks/following{/other_user}","gists_url":"https://api.github.com/users/Sage-Bionetworks/gists{/gist_id}","starred_url":"https://api.github.com/users/Sage-Bionetworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sage-Bionetworks/subscriptions","organizations_url":"https://api.github.com/users/Sage-Bionetworks/orgs","repos_url":"https://api.github.com/users/Sage-Bionetworks/repos","events_url":"https://api.github.com/users/Sage-Bionetworks/events{/privacy}","received_events_url":"https://api.github.com/users/Sage-Bionetworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK","description":"SDK for creating ResearchKit-based Bridge apps for iOS","fork":false,"url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK","forks_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/forks","keys_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/teams","hooks_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/hooks","issue_events_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues/events{/number}","events_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/events","assignees_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/assignees{/user}","branches_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/branches{/branch}","tags_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/tags","blobs_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/languages","stargazers_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/stargazers","contributors_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/contributors","subscribers_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/subscribers","subscription_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/subscription","commits_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/contents/{+path}","compare_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/merges","archive_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/downloads","issues_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues{/number}","pulls_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/labels{/name}","releases_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/releases{/id}","deployments_url":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/deployments","created_at":"2016-02-04T18:59:59Z","updated_at":"2016-02-04T19:06:55Z","pushed_at":"2016-08-17T03:57:02Z","git_url":"git://github.com/Sage-Bionetworks/BridgeAppSDK.git","ssh_url":"git@github.com:Sage-Bionetworks/BridgeAppSDK.git","clone_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK.git","svn_url":"https://github.com/Sage-Bionetworks/BridgeAppSDK","homepage":null,"size":882,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90"},"html":{"href":"https://github.com/Sage-Bionetworks/BridgeAppSDK/pull/90"},"issue":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues/90"},"comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/Sage-Bionetworks/BridgeAppSDK/statuses/b8ebbd47b8d75207420c25b8752bb3511d4b35cf"}}}}
{"actor":{"display_login":"syoung-smallwisdom"}}