{"action":"created","comment":{"url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/comments/206837643","pull_request_review_id":142325489,"id":206837643,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjgzNzY0Mw==","diff_hunk":"@@ -613,30 +613,38 @@ void USpatialInterop::ResolvePendingIncomingObjectUpdates(UObject* Object, const\n \t\tUSpatialActorChannel* DependentChannel = ChannelProperties.Key;\n \t\tFPendingIncomingProperties& Properties = ChannelProperties.Value;\n \n-\t\t// Trigger pending updates.\n-\t\tDependentChannel->PreReceiveSpatialUpdate(Object);\n-\n+\t\t// Replicated Properties\n \t\tTSet<UProperty*> RepNotifies;\n-\t\tfor (const FRepHandleData* RepData : Properties.Key)\n+\t\tfor (TPair<UObject*, TArray<const FRepHandleData*>>& ObjsToReplicate : Properties.Key)\n \t\t{\n-\t\t\tApplyIncomingReplicatedPropertyUpdate(*RepData, DependentChannel->Actor, &Object, RepNotifies);\n-\t\t\tUE_LOG(LogSpatialGDKInterop, Log, TEXT(\"%s: Received queued object replicated property update. actor %s (%lld), property %s\"),\n-\t\t\t\t*SpatialOSInstance->GetWorkerId(),\n-\t\t\t\t*DependentChannel->Actor->GetName(),\n-\t\t\t\tDependentChannel->GetEntityId().ToSpatialEntityId(),\n-\t\t\t\t*RepData->Property->GetName());\n+\t\t\t// Iterate through our list of target objects, either an actor or component\n+\t\t\t// For each, we resolve all replicated properties under that object\n+\t\t\tUObject* TargetObject = ObjsToReplicate.Key;\n+\t\t\tDependentChannel->PreReceiveSpatialUpdate(TargetObject);\n+\n+\t\t\tfor (const FRepHandleData* RepData : ObjsToReplicate.Value) {","path":"Source/SpatialGDK/Private/SpatialInterop.cpp","position":50,"original_position":50,"commit_id":"6bfb5355c948cf967a039c802828941d6c2ed71b","original_commit_id":"6bfb5355c948cf967a039c802828941d6c2ed71b","user":{"login":"improbable-valentyn","id":32096431,"node_id":"MDQ6VXNlcjMyMDk2NDMx","avatar_url":"https://avatars0.githubusercontent.com/u/32096431?v=4","gravatar_id":"","url":"https://api.github.com/users/improbable-valentyn","html_url":"https://github.com/improbable-valentyn","followers_url":"https://api.github.com/users/improbable-valentyn/followers","following_url":"https://api.github.com/users/improbable-valentyn/following{/other_user}","gists_url":"https://api.github.com/users/improbable-valentyn/gists{/gist_id}","starred_url":"https://api.github.com/users/improbable-valentyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/improbable-valentyn/subscriptions","organizations_url":"https://api.github.com/users/improbable-valentyn/orgs","repos_url":"https://api.github.com/users/improbable-valentyn/repos","events_url":"https://api.github.com/users/improbable-valentyn/events{/privacy}","received_events_url":"https://api.github.com/users/improbable-valentyn/received_events","type":"User","site_admin":false},"body":"Nit: `{` should be on a new line.","created_at":"2018-08-01T11:01:38Z","updated_at":"2018-08-01T11:01:38Z","html_url":"https://github.com/spatialos/UnrealGDK/pull/251#discussion_r206837643","pull_request_url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/comments/206837643"},"html":{"href":"https://github.com/spatialos/UnrealGDK/pull/251#discussion_r206837643"},"pull_request":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251"}}},"pull_request":{"url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251","id":205157743,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MTU3NzQz","html_url":"https://github.com/spatialos/UnrealGDK/pull/251","diff_url":"https://github.com/spatialos/UnrealGDK/pull/251.diff","patch_url":"https://github.com/spatialos/UnrealGDK/pull/251.patch","issue_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues/251","number":251,"state":"open","locked":false,"title":"UNR-481: Pending Replicated Property Updates Resolve Correctly to Owning Object","user":{"login":"wanqizhu","id":14876488,"node_id":"MDQ6VXNlcjE0ODc2NDg4","avatar_url":"https://avatars0.githubusercontent.com/u/14876488?v=4","gravatar_id":"","url":"https://api.github.com/users/wanqizhu","html_url":"https://github.com/wanqizhu","followers_url":"https://api.github.com/users/wanqizhu/followers","following_url":"https://api.github.com/users/wanqizhu/following{/other_user}","gists_url":"https://api.github.com/users/wanqizhu/gists{/gist_id}","starred_url":"https://api.github.com/users/wanqizhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanqizhu/subscriptions","organizations_url":"https://api.github.com/users/wanqizhu/orgs","repos_url":"https://api.github.com/users/wanqizhu/repos","events_url":"https://api.github.com/users/wanqizhu/events{/privacy}","received_events_url":"https://api.github.com/users/wanqizhu/received_events","type":"User","site_admin":false},"body":"#### Description\r\nSee https://improbableio.atlassian.net/browse/UNR-481\r\n\r\nTldr: When there are pending object refs for property updates, e.g. when you cross over a worker boundary and your PlayerController, which has a pointer to PlayerState, is spawned before PlayerState, we need to correctly apply replicated properties inside PlayerState, link it up with PlayerController, and notify PlayerController's OnRepNotifies. This is currently broken, especially when we resolve a property owned not by the root actor but by a sub ActorComponent.\r\n\r\nWe change typebinding and how we store PendingIncomingObjectUpdates to keep track of the owning object (TargetObject, either Actor or ActorComponent but not necessarily the owning actor of the root ActorChannel). This way, when we resolve our IncomingObject, we correctly link it with TargetObject->UnresolvedObjectRef as a property field and call corresponding OnRepNotifies.\r\n\r\n**Note that typebinding will need to be regenerated.**\r\n\r\n#### Tests\r\nRunning across worker boundaries no longer throw warning: \"can't find onrep-notify function.\" Inspecting shows that indeed, the PlayerController's Pawn starts out NULL and gets set to the correct IncomingObject.\r\n\r\nNeed to explicitly test for incoming property updates for subobjects.\r\n\r\n#### Primary reviewers\r\n@improbable-valentyn @m-samiec ","created_at":"2018-07-31T15:44:03Z","updated_at":"2018-08-01T11:01:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c169b0de9d86f2dbd29c441b0c88123aa3f85731","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1002330437,"node_id":"MDU6TGFiZWwxMDAyMzMwNDM3","url":"https://api.github.com/repos/spatialos/UnrealGDK/labels/size/M","name":"size/M","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251/commits","review_comments_url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251/comments","review_comment_url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues/251/comments","statuses_url":"https://api.github.com/repos/spatialos/UnrealGDK/statuses/6bfb5355c948cf967a039c802828941d6c2ed71b","head":{"label":"spatialos:bugfix/UNR-481-Correctly-Resolve-Pending-Incoming-Object-Updates","ref":"bugfix/UNR-481-Correctly-Resolve-Pending-Incoming-Object-Updates","sha":"6bfb5355c948cf967a039c802828941d6c2ed71b","user":{"login":"spatialos","id":23554165,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTU0MTY1","avatar_url":"https://avatars2.githubusercontent.com/u/23554165?v=4","gravatar_id":"","url":"https://api.github.com/users/spatialos","html_url":"https://github.com/spatialos","followers_url":"https://api.github.com/users/spatialos/followers","following_url":"https://api.github.com/users/spatialos/following{/other_user}","gists_url":"https://api.github.com/users/spatialos/gists{/gist_id}","starred_url":"https://api.github.com/users/spatialos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatialos/subscriptions","organizations_url":"https://api.github.com/users/spatialos/orgs","repos_url":"https://api.github.com/users/spatialos/repos","events_url":"https://api.github.com/users/spatialos/events{/privacy}","received_events_url":"https://api.github.com/users/spatialos/received_events","type":"Organization","site_admin":false},"repo":{"id":109980189,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk5ODAxODk=","name":"UnrealGDK","full_name":"spatialos/UnrealGDK","owner":{"login":"spatialos","id":23554165,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTU0MTY1","avatar_url":"https://avatars2.githubusercontent.com/u/23554165?v=4","gravatar_id":"","url":"https://api.github.com/users/spatialos","html_url":"https://github.com/spatialos","followers_url":"https://api.github.com/users/spatialos/followers","following_url":"https://api.github.com/users/spatialos/following{/other_user}","gists_url":"https://api.github.com/users/spatialos/gists{/gist_id}","starred_url":"https://api.github.com/users/spatialos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatialos/subscriptions","organizations_url":"https://api.github.com/users/spatialos/orgs","repos_url":"https://api.github.com/users/spatialos/repos","events_url":"https://api.github.com/users/spatialos/events{/privacy}","received_events_url":"https://api.github.com/users/spatialos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spatialos/UnrealGDK","description":null,"fork":false,"url":"https://api.github.com/repos/spatialos/UnrealGDK","forks_url":"https://api.github.com/repos/spatialos/UnrealGDK/forks","keys_url":"https://api.github.com/repos/spatialos/UnrealGDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spatialos/UnrealGDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spatialos/UnrealGDK/teams","hooks_url":"https://api.github.com/repos/spatialos/UnrealGDK/hooks","issue_events_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues/events{/number}","events_url":"https://api.github.com/repos/spatialos/UnrealGDK/events","assignees_url":"https://api.github.com/repos/spatialos/UnrealGDK/assignees{/user}","branches_url":"https://api.github.com/repos/spatialos/UnrealGDK/branches{/branch}","tags_url":"https://api.github.com/repos/spatialos/UnrealGDK/tags","blobs_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spatialos/UnrealGDK/statuses/{sha}","languages_url":"https://api.github.com/repos/spatialos/UnrealGDK/languages","stargazers_url":"https://api.github.com/repos/spatialos/UnrealGDK/stargazers","contributors_url":"https://api.github.com/repos/spatialos/UnrealGDK/contributors","subscribers_url":"https://api.github.com/repos/spatialos/UnrealGDK/subscribers","subscription_url":"https://api.github.com/repos/spatialos/UnrealGDK/subscription","commits_url":"https://api.github.com/repos/spatialos/UnrealGDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/spatialos/UnrealGDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/spatialos/UnrealGDK/contents/{+path}","compare_url":"https://api.github.com/repos/spatialos/UnrealGDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spatialos/UnrealGDK/merges","archive_url":"https://api.github.com/repos/spatialos/UnrealGDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spatialos/UnrealGDK/downloads","issues_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues{/number}","pulls_url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls{/number}","milestones_url":"https://api.github.com/repos/spatialos/UnrealGDK/milestones{/number}","notifications_url":"https://api.github.com/repos/spatialos/UnrealGDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spatialos/UnrealGDK/labels{/name}","releases_url":"https://api.github.com/repos/spatialos/UnrealGDK/releases{/id}","deployments_url":"https://api.github.com/repos/spatialos/UnrealGDK/deployments","created_at":"2017-11-08T13:35:16Z","updated_at":"2018-08-01T10:44:56Z","pushed_at":"2018-08-01T10:47:10Z","git_url":"git://github.com/spatialos/UnrealGDK.git","ssh_url":"git@github.com:spatialos/UnrealGDK.git","clone_url":"https://github.com/spatialos/UnrealGDK.git","svn_url":"https://github.com/spatialos/UnrealGDK","homepage":null,"size":56203,"stargazers_count":36,"watchers_count":36,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":6,"watchers":36,"default_branch":"master"}},"base":{"label":"spatialos:master","ref":"master","sha":"67982d0b6dd25264a7be21f221a20bdecf846c84","user":{"login":"spatialos","id":23554165,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTU0MTY1","avatar_url":"https://avatars2.githubusercontent.com/u/23554165?v=4","gravatar_id":"","url":"https://api.github.com/users/spatialos","html_url":"https://github.com/spatialos","followers_url":"https://api.github.com/users/spatialos/followers","following_url":"https://api.github.com/users/spatialos/following{/other_user}","gists_url":"https://api.github.com/users/spatialos/gists{/gist_id}","starred_url":"https://api.github.com/users/spatialos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatialos/subscriptions","organizations_url":"https://api.github.com/users/spatialos/orgs","repos_url":"https://api.github.com/users/spatialos/repos","events_url":"https://api.github.com/users/spatialos/events{/privacy}","received_events_url":"https://api.github.com/users/spatialos/received_events","type":"Organization","site_admin":false},"repo":{"id":109980189,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk5ODAxODk=","name":"UnrealGDK","full_name":"spatialos/UnrealGDK","owner":{"login":"spatialos","id":23554165,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTU0MTY1","avatar_url":"https://avatars2.githubusercontent.com/u/23554165?v=4","gravatar_id":"","url":"https://api.github.com/users/spatialos","html_url":"https://github.com/spatialos","followers_url":"https://api.github.com/users/spatialos/followers","following_url":"https://api.github.com/users/spatialos/following{/other_user}","gists_url":"https://api.github.com/users/spatialos/gists{/gist_id}","starred_url":"https://api.github.com/users/spatialos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spatialos/subscriptions","organizations_url":"https://api.github.com/users/spatialos/orgs","repos_url":"https://api.github.com/users/spatialos/repos","events_url":"https://api.github.com/users/spatialos/events{/privacy}","received_events_url":"https://api.github.com/users/spatialos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spatialos/UnrealGDK","description":null,"fork":false,"url":"https://api.github.com/repos/spatialos/UnrealGDK","forks_url":"https://api.github.com/repos/spatialos/UnrealGDK/forks","keys_url":"https://api.github.com/repos/spatialos/UnrealGDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spatialos/UnrealGDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spatialos/UnrealGDK/teams","hooks_url":"https://api.github.com/repos/spatialos/UnrealGDK/hooks","issue_events_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues/events{/number}","events_url":"https://api.github.com/repos/spatialos/UnrealGDK/events","assignees_url":"https://api.github.com/repos/spatialos/UnrealGDK/assignees{/user}","branches_url":"https://api.github.com/repos/spatialos/UnrealGDK/branches{/branch}","tags_url":"https://api.github.com/repos/spatialos/UnrealGDK/tags","blobs_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spatialos/UnrealGDK/statuses/{sha}","languages_url":"https://api.github.com/repos/spatialos/UnrealGDK/languages","stargazers_url":"https://api.github.com/repos/spatialos/UnrealGDK/stargazers","contributors_url":"https://api.github.com/repos/spatialos/UnrealGDK/contributors","subscribers_url":"https://api.github.com/repos/spatialos/UnrealGDK/subscribers","subscription_url":"https://api.github.com/repos/spatialos/UnrealGDK/subscription","commits_url":"https://api.github.com/repos/spatialos/UnrealGDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/spatialos/UnrealGDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/spatialos/UnrealGDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/spatialos/UnrealGDK/contents/{+path}","compare_url":"https://api.github.com/repos/spatialos/UnrealGDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spatialos/UnrealGDK/merges","archive_url":"https://api.github.com/repos/spatialos/UnrealGDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spatialos/UnrealGDK/downloads","issues_url":"https://api.github.com/repos/spatialos/UnrealGDK/issues{/number}","pulls_url":"https://api.github.com/repos/spatialos/UnrealGDK/pulls{/number}","milestones_url":"https://api.github.com/repos/spatialos/UnrealGDK/milestones{/number}","notifications_url":"https://api.github.com/repos/spatialos/UnrealGDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spatialos/UnrealGDK/labels{/name}","releases_url":"https://api.github.com/repos/spatialos/UnrealGDK/releases{/id}","deployments_url":"https://api.github.com/repos/spatialos/UnrealGDK/deployments","created_at":"2017-11-08T13:35:16Z","updated_at":"2018-08-01T10:44:56Z","pushed_at":"2018-08-01T10:47:10Z","git_url":"git://github.com/spatialos/UnrealGDK.git","ssh_url":"git@github.com:spatialos/UnrealGDK.git","clone_url":"https://github.com/spatialos/UnrealGDK.git","svn_url":"https://github.com/spatialos/UnrealGDK","homepage":null,"size":56203,"stargazers_count":36,"watchers_count":36,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2,"open_issues":6,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251"},"html":{"href":"https://github.com/spatialos/UnrealGDK/pull/251"},"issue":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/issues/251"},"comments":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/spatialos/UnrealGDK/statuses/6bfb5355c948cf967a039c802828941d6c2ed71b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"improbable-valentyn"}}