{"action":"created","comment":{"url":"https://api.github.com/repos/hughsie/fwupd/pulls/comments/215963767","pull_request_review_id":153347934,"id":215963767,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTk2Mzc2Nw==","diff_hunk":"@@ -1223,15 +1223,26 @@ fu_engine_install_tasks (FuEngine *self,\n \t/* refresh all devices in case they replugged */\n \tdevices_after = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);\n \tfor (guint i = 0; i < devices->len; i++) {\n-\t\tFuDevice *old = g_ptr_array_index (devices, i);\n-\t\tFuDevice *new;\n+\t\tFuDevice *old_device = g_ptr_array_index (devices, i);\n+\t\tFuDevice *old_parent;\n+\t\tFuDevice *new_parent;\n+\t\tFuDevice *new_device;\n \t\tg_autoptr(GError) error_local = NULL;\n-\t\tnew = fu_device_list_get_by_id (self->device_list, fu_device_get_id (old), &error_local);\n-\t\tif (new == NULL) {\n+\t\tnew_device = fu_device_list_get_by_id (self->device_list, fu_device_get_id (old_device), &error_local);\n+\t\tif (new_device == NULL) {\n \t\t\tg_warning (\"failed to find new device: %s\", error_local->message);\n \t\t\tcontinue;\n \t\t}\n-\t\tg_ptr_array_add (devices_after, g_object_ref (new));\n+\t\told_parent = fu_device_get_parent (old_device);\n+\t\tif (old_parent != NULL) {\n+\t\t\tnew_parent = fu_device_list_get_by_id (self->device_list, fu_device_get_id (old_parent), &error_local);\n+\t\t\tif (new_parent == NULL) {\n+\t\t\t\tg_warning (\"failed to find new parent: %s\", error_local->message);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\tfu_device_set_parent (new_device, new_parent);","path":"src/fu-engine.c","position":32,"original_position":26,"commit_id":"b08da70b74ca471754d014a1c7b22fb595bf8128","original_commit_id":"b08da70b74ca471754d014a1c7b22fb595bf8128","user":{"login":"superm1","id":494526,"node_id":"MDQ6VXNlcjQ5NDUyNg==","avatar_url":"https://avatars0.githubusercontent.com/u/494526?v=4","gravatar_id":"","url":"https://api.github.com/users/superm1","html_url":"https://github.com/superm1","followers_url":"https://api.github.com/users/superm1/followers","following_url":"https://api.github.com/users/superm1/following{/other_user}","gists_url":"https://api.github.com/users/superm1/gists{/gist_id}","starred_url":"https://api.github.com/users/superm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superm1/subscriptions","organizations_url":"https://api.github.com/users/superm1/orgs","repos_url":"https://api.github.com/users/superm1/repos","events_url":"https://api.github.com/users/superm1/events{/privacy}","received_events_url":"https://api.github.com/users/superm1/received_events","type":"User","site_admin":false},"body":"Part of the problem I'm hitting is that the parents are wrong for devices that happened earlier in the transaction (ie they're not in replug so `fu_device_list_replace` doesn't run).\r\n\r\nI've experimented with lots of things to solve this but I'm thinking now it might just be better to not try to rely on parents as heavily in `composite_cleanup`.","created_at":"2018-09-07T13:46:54Z","updated_at":"2018-09-07T13:46:54Z","html_url":"https://github.com/hughsie/fwupd/pull/728#discussion_r215963767","pull_request_url":"https://api.github.com/repos/hughsie/fwupd/pulls/728","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/hughsie/fwupd/pulls/comments/215963767"},"html":{"href":"https://github.com/hughsie/fwupd/pull/728#discussion_r215963767"},"pull_request":{"href":"https://api.github.com/repos/hughsie/fwupd/pulls/728"}},"in_reply_to_id":215892501},"pull_request":{"url":"https://api.github.com/repos/hughsie/fwupd/pulls/728","id":213763927,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNzYzOTI3","html_url":"https://github.com/hughsie/fwupd/pull/728","diff_url":"https://github.com/hughsie/fwupd/pull/728.diff","patch_url":"https://github.com/hughsie/fwupd/pull/728.patch","issue_url":"https://api.github.com/repos/hughsie/fwupd/issues/728","number":728,"state":"open","locked":false,"title":"fu-device-list: Look at both logical and physical IDs for replug matching","user":{"login":"superm1","id":494526,"node_id":"MDQ6VXNlcjQ5NDUyNg==","avatar_url":"https://avatars0.githubusercontent.com/u/494526?v=4","gravatar_id":"","url":"https://api.github.com/users/superm1","html_url":"https://github.com/superm1","followers_url":"https://api.github.com/users/superm1/followers","following_url":"https://api.github.com/users/superm1/following{/other_user}","gists_url":"https://api.github.com/users/superm1/gists{/gist_id}","starred_url":"https://api.github.com/users/superm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superm1/subscriptions","organizations_url":"https://api.github.com/users/superm1/orgs","repos_url":"https://api.github.com/users/superm1/repos","events_url":"https://api.github.com/users/superm1/events{/privacy}","received_events_url":"https://api.github.com/users/superm1/received_events","type":"User","site_admin":false},"body":"This resolves erroneously matching a logical child to it's parent if\r\nthe child is in replug.","created_at":"2018-09-06T22:06:06Z","updated_at":"2018-09-07T13:46:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5797f21c4e372c1d604b32e95646151023e92ad0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hughsie/fwupd/pulls/728/commits","review_comments_url":"https://api.github.com/repos/hughsie/fwupd/pulls/728/comments","review_comment_url":"https://api.github.com/repos/hughsie/fwupd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hughsie/fwupd/issues/728/comments","statuses_url":"https://api.github.com/repos/hughsie/fwupd/statuses/b08da70b74ca471754d014a1c7b22fb595bf8128","head":{"label":"hughsie:wip/superm1/replug","ref":"wip/superm1/replug","sha":"b08da70b74ca471754d014a1c7b22fb595bf8128","user":{"login":"hughsie","id":151380,"node_id":"MDQ6VXNlcjE1MTM4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/151380?v=4","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"repo":{"id":31374735,"node_id":"MDEwOlJlcG9zaXRvcnkzMTM3NDczNQ==","name":"fwupd","full_name":"hughsie/fwupd","owner":{"login":"hughsie","id":151380,"node_id":"MDQ6VXNlcjE1MTM4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/151380?v=4","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hughsie/fwupd","description":"A simple daemon to allow session software to update firmware","fork":false,"url":"https://api.github.com/repos/hughsie/fwupd","forks_url":"https://api.github.com/repos/hughsie/fwupd/forks","keys_url":"https://api.github.com/repos/hughsie/fwupd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hughsie/fwupd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hughsie/fwupd/teams","hooks_url":"https://api.github.com/repos/hughsie/fwupd/hooks","issue_events_url":"https://api.github.com/repos/hughsie/fwupd/issues/events{/number}","events_url":"https://api.github.com/repos/hughsie/fwupd/events","assignees_url":"https://api.github.com/repos/hughsie/fwupd/assignees{/user}","branches_url":"https://api.github.com/repos/hughsie/fwupd/branches{/branch}","tags_url":"https://api.github.com/repos/hughsie/fwupd/tags","blobs_url":"https://api.github.com/repos/hughsie/fwupd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hughsie/fwupd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hughsie/fwupd/git/refs{/sha}","trees_url":"https://api.github.com/repos/hughsie/fwupd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hughsie/fwupd/statuses/{sha}","languages_url":"https://api.github.com/repos/hughsie/fwupd/languages","stargazers_url":"https://api.github.com/repos/hughsie/fwupd/stargazers","contributors_url":"https://api.github.com/repos/hughsie/fwupd/contributors","subscribers_url":"https://api.github.com/repos/hughsie/fwupd/subscribers","subscription_url":"https://api.github.com/repos/hughsie/fwupd/subscription","commits_url":"https://api.github.com/repos/hughsie/fwupd/commits{/sha}","git_commits_url":"https://api.github.com/repos/hughsie/fwupd/git/commits{/sha}","comments_url":"https://api.github.com/repos/hughsie/fwupd/comments{/number}","issue_comment_url":"https://api.github.com/repos/hughsie/fwupd/issues/comments{/number}","contents_url":"https://api.github.com/repos/hughsie/fwupd/contents/{+path}","compare_url":"https://api.github.com/repos/hughsie/fwupd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hughsie/fwupd/merges","archive_url":"https://api.github.com/repos/hughsie/fwupd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hughsie/fwupd/downloads","issues_url":"https://api.github.com/repos/hughsie/fwupd/issues{/number}","pulls_url":"https://api.github.com/repos/hughsie/fwupd/pulls{/number}","milestones_url":"https://api.github.com/repos/hughsie/fwupd/milestones{/number}","notifications_url":"https://api.github.com/repos/hughsie/fwupd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hughsie/fwupd/labels{/name}","releases_url":"https://api.github.com/repos/hughsie/fwupd/releases{/id}","deployments_url":"https://api.github.com/repos/hughsie/fwupd/deployments","created_at":"2015-02-26T15:52:25Z","updated_at":"2018-09-07T13:29:31Z","pushed_at":"2018-09-07T13:41:35Z","git_url":"git://github.com/hughsie/fwupd.git","ssh_url":"git@github.com:hughsie/fwupd.git","clone_url":"https://github.com/hughsie/fwupd.git","svn_url":"https://github.com/hughsie/fwupd","homepage":"","size":8519,"stargazers_count":381,"watchers_count":381,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":74,"open_issues":25,"watchers":381,"default_branch":"master"}},"base":{"label":"hughsie:master","ref":"master","sha":"194c76536e6ec4f13a2ebafba663dc64a5908f3b","user":{"login":"hughsie","id":151380,"node_id":"MDQ6VXNlcjE1MTM4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/151380?v=4","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"repo":{"id":31374735,"node_id":"MDEwOlJlcG9zaXRvcnkzMTM3NDczNQ==","name":"fwupd","full_name":"hughsie/fwupd","owner":{"login":"hughsie","id":151380,"node_id":"MDQ6VXNlcjE1MTM4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/151380?v=4","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hughsie/fwupd","description":"A simple daemon to allow session software to update firmware","fork":false,"url":"https://api.github.com/repos/hughsie/fwupd","forks_url":"https://api.github.com/repos/hughsie/fwupd/forks","keys_url":"https://api.github.com/repos/hughsie/fwupd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hughsie/fwupd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hughsie/fwupd/teams","hooks_url":"https://api.github.com/repos/hughsie/fwupd/hooks","issue_events_url":"https://api.github.com/repos/hughsie/fwupd/issues/events{/number}","events_url":"https://api.github.com/repos/hughsie/fwupd/events","assignees_url":"https://api.github.com/repos/hughsie/fwupd/assignees{/user}","branches_url":"https://api.github.com/repos/hughsie/fwupd/branches{/branch}","tags_url":"https://api.github.com/repos/hughsie/fwupd/tags","blobs_url":"https://api.github.com/repos/hughsie/fwupd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hughsie/fwupd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hughsie/fwupd/git/refs{/sha}","trees_url":"https://api.github.com/repos/hughsie/fwupd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hughsie/fwupd/statuses/{sha}","languages_url":"https://api.github.com/repos/hughsie/fwupd/languages","stargazers_url":"https://api.github.com/repos/hughsie/fwupd/stargazers","contributors_url":"https://api.github.com/repos/hughsie/fwupd/contributors","subscribers_url":"https://api.github.com/repos/hughsie/fwupd/subscribers","subscription_url":"https://api.github.com/repos/hughsie/fwupd/subscription","commits_url":"https://api.github.com/repos/hughsie/fwupd/commits{/sha}","git_commits_url":"https://api.github.com/repos/hughsie/fwupd/git/commits{/sha}","comments_url":"https://api.github.com/repos/hughsie/fwupd/comments{/number}","issue_comment_url":"https://api.github.com/repos/hughsie/fwupd/issues/comments{/number}","contents_url":"https://api.github.com/repos/hughsie/fwupd/contents/{+path}","compare_url":"https://api.github.com/repos/hughsie/fwupd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hughsie/fwupd/merges","archive_url":"https://api.github.com/repos/hughsie/fwupd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hughsie/fwupd/downloads","issues_url":"https://api.github.com/repos/hughsie/fwupd/issues{/number}","pulls_url":"https://api.github.com/repos/hughsie/fwupd/pulls{/number}","milestones_url":"https://api.github.com/repos/hughsie/fwupd/milestones{/number}","notifications_url":"https://api.github.com/repos/hughsie/fwupd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hughsie/fwupd/labels{/name}","releases_url":"https://api.github.com/repos/hughsie/fwupd/releases{/id}","deployments_url":"https://api.github.com/repos/hughsie/fwupd/deployments","created_at":"2015-02-26T15:52:25Z","updated_at":"2018-09-07T13:29:31Z","pushed_at":"2018-09-07T13:41:35Z","git_url":"git://github.com/hughsie/fwupd.git","ssh_url":"git@github.com:hughsie/fwupd.git","clone_url":"https://github.com/hughsie/fwupd.git","svn_url":"https://github.com/hughsie/fwupd","homepage":"","size":8519,"stargazers_count":381,"watchers_count":381,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":74,"open_issues":25,"watchers":381,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hughsie/fwupd/pulls/728"},"html":{"href":"https://github.com/hughsie/fwupd/pull/728"},"issue":{"href":"https://api.github.com/repos/hughsie/fwupd/issues/728"},"comments":{"href":"https://api.github.com/repos/hughsie/fwupd/issues/728/comments"},"review_comments":{"href":"https://api.github.com/repos/hughsie/fwupd/pulls/728/comments"},"review_comment":{"href":"https://api.github.com/repos/hughsie/fwupd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hughsie/fwupd/pulls/728/commits"},"statuses":{"href":"https://api.github.com/repos/hughsie/fwupd/statuses/b08da70b74ca471754d014a1c7b22fb595bf8128"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"superm1"}}