{"action":"created","issue":{"url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/issues/2365","repository_url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity","labels_url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/issues/2365/labels{/name}","comments_url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/issues/2365/comments","events_url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/issues/2365/events","html_url":"https://github.com/playgameservices/play-games-plugin-for-unity/issues/2365","id":383071568,"node_id":"MDU6SXNzdWUzODMwNzE1Njg=","number":2365,"title":"Save Games crash when Resolving conflict","user":{"login":"irina88","id":881929,"node_id":"MDQ6VXNlcjg4MTkyOQ==","avatar_url":"https://avatars0.githubusercontent.com/u/881929?v=4","gravatar_id":"","url":"https://api.github.com/users/irina88","html_url":"https://github.com/irina88","followers_url":"https://api.github.com/users/irina88/followers","following_url":"https://api.github.com/users/irina88/following{/other_user}","gists_url":"https://api.github.com/users/irina88/gists{/gist_id}","starred_url":"https://api.github.com/users/irina88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irina88/subscriptions","organizations_url":"https://api.github.com/users/irina88/orgs","repos_url":"https://api.github.com/users/irina88/repos","events_url":"https://api.github.com/users/irina88/events{/privacy}","received_events_url":"https://api.github.com/users/irina88/received_events","type":"User","site_admin":false},"labels":[{"id":69871927,"node_id":"MDU6TGFiZWw2OTg3MTkyNw==","url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-21T11:18:45Z","updated_at":"2018-11-23T12:32:07Z","closed_at":null,"author_association":"NONE","body":"I am getting a crash every time I call the ChooseMetadata function from the IConflictResolver interface that comes as a parameter for the manual conflict resolution delegate.\r\nHere is the log:\r\n\r\n\"_at libgpg.00156c5e(Native Method)\r\nat libgpg.gpg::SnapshotManager::ResolveConflict(gpg::SnapshotMetadata const&, gpg::SnapshotMetadataChange const&, std::string const&, std::function<void (gpg::SnapshotManager::CommitResponse const&)>)(SnapshotManager:92)\r\nat libgpg.SnapshotManager_ResolveConflict(SnapshotManager_ResolveConflict:128)\r\nat Unknown.00007eb0(Unknown Source:0)\r\nat SnapshotManager.SnapshotManager_ResolveConflict(Native Method)\r\nat SnapshotManager.Resolve(<0x001e8>:488)\r\nat NativeConflictResolver.ChooseMetadata(<0x0012f>:303)\r\nat AndroidCloudSaveService.ConflictResolver(<0x00097>:151)\r\nat <ToOnGameThread>c__AnonStorey2.<>m__0(<0x0005b>:91)\r\nat PlayGamesHelperObject.Update(<0x000ef>:239)\r\nat Object.runtime_invoke_void__this__(Native Method)\r\nat libmono.000222bb(Native Method)\r\nat libmono.mono_runtime_invoke(mono_runtime_invoke:136)\r\nat libunity.00527774(Native Method)\r\nat libunity.0050acf4(Native Method)\r\nat libunity.00203120(Native Method)\r\nat libunity.0034db34(Native Method)\r\nat libunity.0063545c(Native Method)\r\nat libunity.0063796c(Native Method)\r\nat base.0006d0e3(Native Method)_\r\n\""},"comment":{"url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/issues/comments/441229839","html_url":"https://github.com/playgameservices/play-games-plugin-for-unity/issues/2365#issuecomment-441229839","issue_url":"https://api.github.com/repos/playgameservices/play-games-plugin-for-unity/issues/2365","id":441229839,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTIyOTgzOQ==","user":{"login":"olehkuznetsov","id":44271635,"node_id":"MDQ6VXNlcjQ0MjcxNjM1","avatar_url":"https://avatars3.githubusercontent.com/u/44271635?v=4","gravatar_id":"","url":"https://api.github.com/users/olehkuznetsov","html_url":"https://github.com/olehkuznetsov","followers_url":"https://api.github.com/users/olehkuznetsov/followers","following_url":"https://api.github.com/users/olehkuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/olehkuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/olehkuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olehkuznetsov/subscriptions","organizations_url":"https://api.github.com/users/olehkuznetsov/orgs","repos_url":"https://api.github.com/users/olehkuznetsov/repos","events_url":"https://api.github.com/users/olehkuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/olehkuznetsov/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T12:32:07Z","updated_at":"2018-11-23T12:32:07Z","author_association":"CONTRIBUTOR","body":"This is the  implementation for 'OpenWithAutomaticConflictResolution'\r\nAs you can see it uses inside resolver.ChooseMetadata too.\r\nCan you check if it crashes with 'ConflictResolutionStrategy.UseUnmerged', please? \r\nIf it doens't work it means we have an bug in the plugin.\r\nAnd if it works it, probably, means there is something in your code and we can try to figure out the issue if you post the code which calls resolver.ChooseMetadata.\r\n```\r\n        public void OpenWithAutomaticConflictResolution(string filename, DataSource source,\r\n            ConflictResolutionStrategy resolutionStrategy,\r\n            bool prefetchDataOnConflict, ConflictCallback conflictCallback,\r\n            Action<SavedGameRequestStatus, ISavedGameMetadata> completedCallback)\r\n        {\r\n            Misc.CheckNotNull(filename);\r\n            Misc.CheckNotNull(completedCallback);\r\n            completedCallback = ToOnGameThread(completedCallback);\r\n\r\n            if (conflictCallback == null) {\r\n                conflictCallback =\r\n                    (resolver, original, originalData, unmerged, unmergedData) => {\r\n                    switch (resolutionStrategy) {\r\n                    case ConflictResolutionStrategy.UseOriginal:\r\n                        resolver.ChooseMetadata (original);\r\n                        return;\r\n                    case ConflictResolutionStrategy.UseUnmerged:\r\n                        resolver.ChooseMetadata (unmerged);\r\n                        return;\r\n                    case ConflictResolutionStrategy.UseLongestPlaytime:\r\n                        if (original.TotalTimePlayed >= unmerged.TotalTimePlayed) {\r\n                            resolver.ChooseMetadata (original);\r\n                        } else {\r\n                            resolver.ChooseMetadata (unmerged);\r\n                        }\r\n                        return;\r\n                    default:\r\n                        Logger.e (\"Unhandled strategy \" + resolutionStrategy);\r\n                        completedCallback (SavedGameRequestStatus.InternalError, null);\r\n                        return;\r\n                    }\r\n                };\r\n            }\r\n\r\n             conflictCallback = ToOnGameThread(conflictCallback);\r\n\r\n            if (!IsValidFilename(filename))\r\n            {\r\n                Logger.e(\"Received invalid filename: \" + filename);\r\n                completedCallback(SavedGameRequestStatus.BadInputError, null);\r\n                return;\r\n            }\r\n\r\n            InternalOpen(filename, source, resolutionStrategy, prefetchDataOnConflict, conflictCallback,\r\n                completedCallback);\r\n        }\r\n\r\n```\r\n"}}
{"actor":{"display_login":"olehkuznetsov"}}