{"action":"created","issue":{"url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1892","repository_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core","labels_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1892/labels{/name}","comments_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1892/comments","events_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1892/events","html_url":"https://github.com/SharePoint/PnP-Sites-Core/issues/1892","id":355533847,"node_id":"MDU6SXNzdWUzNTU1MzM4NDc=","number":1892,"title":"ExecuteQueryRetry() - What's the point???","user":{"login":"SchauDK","id":13271356,"node_id":"MDQ6VXNlcjEzMjcxMzU2","avatar_url":"https://avatars2.githubusercontent.com/u/13271356?v=4","gravatar_id":"","url":"https://api.github.com/users/SchauDK","html_url":"https://github.com/SchauDK","followers_url":"https://api.github.com/users/SchauDK/followers","following_url":"https://api.github.com/users/SchauDK/following{/other_user}","gists_url":"https://api.github.com/users/SchauDK/gists{/gist_id}","starred_url":"https://api.github.com/users/SchauDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SchauDK/subscriptions","organizations_url":"https://api.github.com/users/SchauDK/orgs","repos_url":"https://api.github.com/users/SchauDK/repos","events_url":"https://api.github.com/users/SchauDK/events{/privacy}","received_events_url":"https://api.github.com/users/SchauDK/received_events","type":"User","site_admin":false},"labels":[{"id":448281456,"node_id":"MDU6TGFiZWw0NDgyODE0NTY=","url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/labels/Investigation%20needed","name":"Investigation needed","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"wobba","id":51104,"node_id":"MDQ6VXNlcjUxMTA0","avatar_url":"https://avatars3.githubusercontent.com/u/51104?v=4","gravatar_id":"","url":"https://api.github.com/users/wobba","html_url":"https://github.com/wobba","followers_url":"https://api.github.com/users/wobba/followers","following_url":"https://api.github.com/users/wobba/following{/other_user}","gists_url":"https://api.github.com/users/wobba/gists{/gist_id}","starred_url":"https://api.github.com/users/wobba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wobba/subscriptions","organizations_url":"https://api.github.com/users/wobba/orgs","repos_url":"https://api.github.com/users/wobba/repos","events_url":"https://api.github.com/users/wobba/events{/privacy}","received_events_url":"https://api.github.com/users/wobba/received_events","type":"User","site_admin":false},"assignees":[{"login":"wobba","id":51104,"node_id":"MDQ6VXNlcjUxMTA0","avatar_url":"https://avatars3.githubusercontent.com/u/51104?v=4","gravatar_id":"","url":"https://api.github.com/users/wobba","html_url":"https://github.com/wobba","followers_url":"https://api.github.com/users/wobba/followers","following_url":"https://api.github.com/users/wobba/following{/other_user}","gists_url":"https://api.github.com/users/wobba/gists{/gist_id}","starred_url":"https://api.github.com/users/wobba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wobba/subscriptions","organizations_url":"https://api.github.com/users/wobba/orgs","repos_url":"https://api.github.com/users/wobba/repos","events_url":"https://api.github.com/users/wobba/events{/privacy}","received_events_url":"https://api.github.com/users/wobba/received_events","type":"User","site_admin":false},{"login":"jansenbe","id":7451219,"node_id":"MDQ6VXNlcjc0NTEyMTk=","avatar_url":"https://avatars2.githubusercontent.com/u/7451219?v=4","gravatar_id":"","url":"https://api.github.com/users/jansenbe","html_url":"https://github.com/jansenbe","followers_url":"https://api.github.com/users/jansenbe/followers","following_url":"https://api.github.com/users/jansenbe/following{/other_user}","gists_url":"https://api.github.com/users/jansenbe/gists{/gist_id}","starred_url":"https://api.github.com/users/jansenbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jansenbe/subscriptions","organizations_url":"https://api.github.com/users/jansenbe/orgs","repos_url":"https://api.github.com/users/jansenbe/repos","events_url":"https://api.github.com/users/jansenbe/events{/privacy}","received_events_url":"https://api.github.com/users/jansenbe/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-08-30T11:00:53Z","updated_at":"2018-11-06T18:07:34Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"We've all learned to use ExecuteQueryRetry() to back off in case of throttling responses from SharePoint. Which btw. is a HUGE issue for ISVs. See https://github.com/SharePoint/sp-dev-docs/issues/1247\r\n\r\nBut what is the point of retrying if the request isn't returning what you requested after the retry?\r\nThis is what we're seeing more and more.\r\n\r\nEg.\r\nApplying a provisioning template where the Field object handler gets throttled.\r\n```Information: 0 : 2018-08-30 09:47:54.2958\t[Fields]\t[1]\t[Debug]\tUpdating field {EF74E985-EBF0-4C48-B722-28EC6266FFA4} in site\t109796ms\t7b2b82a1-83df-4f46-96fd-b175089a4c20\r\nWarning: 0 : 2018-08-30 09:47:57.1248\t[OfficeDevPnP.Core]\t[0]\t[Information]\tCSOM request frequency exceeded usage limits. Sleeping for 500 milliseconds before retrying.\t0ms\t\r\nError: 0 : 2018-08-30 09:47:57.9501\t[Fields]\t[1]\t[Error]\tUpdating field {EF74E985-EBF0-4C48-B722-28EC6266FFA4} failed: The property or field 'SchemaXml' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested. :    at Microsoft.SharePoint.Client.ClientObject.CheckUninitializedProperty(String propName)\r\n   at Microsoft.SharePoint.Client.Field.get_SchemaXml()\r\n   at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectField.UpdateField(Web web, String fieldId, XElement templateFieldElement, PnPMonitoredScope scope, TokenParser parser, String originalFieldXml, Boolean updateFieldIfTypeChanged)\r\n   at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectField.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)\t113450ms\t7b2b82a1-83df-4f46-96fd-b175089a4c20\r\nException thrown: 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException' in OfficeDevPnP.Core.dll\r\n```\r\n\r\nThis is the code from UpdateField\r\n```C#\r\n            var existingField = web.Fields.GetById(Guid.Parse(fieldId));\r\n            web.Context.Load(existingField, f => f.SchemaXml);\r\n            web.Context.ExecuteQueryRetry();\r\n```\r\nSo, it is retrying once waiting 500ms and the request completes, but the SchemaXml property isn't loaded.\r\n\r\nAny comments from the OfficeDevPnP Team about this?\r\n"},"comment":{"url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/comments/436350880","html_url":"https://github.com/SharePoint/PnP-Sites-Core/issues/1892#issuecomment-436350880","issue_url":"https://api.github.com/repos/SharePoint/PnP-Sites-Core/issues/1892","id":436350880,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjM1MDg4MA==","user":{"login":"phawrylak","id":26418285,"node_id":"MDQ6VXNlcjI2NDE4Mjg1","avatar_url":"https://avatars0.githubusercontent.com/u/26418285?v=4","gravatar_id":"","url":"https://api.github.com/users/phawrylak","html_url":"https://github.com/phawrylak","followers_url":"https://api.github.com/users/phawrylak/followers","following_url":"https://api.github.com/users/phawrylak/following{/other_user}","gists_url":"https://api.github.com/users/phawrylak/gists{/gist_id}","starred_url":"https://api.github.com/users/phawrylak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phawrylak/subscriptions","organizations_url":"https://api.github.com/users/phawrylak/orgs","repos_url":"https://api.github.com/users/phawrylak/repos","events_url":"https://api.github.com/users/phawrylak/events{/privacy}","received_events_url":"https://api.github.com/users/phawrylak/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T18:07:33Z","updated_at":"2018-11-06T18:07:33Z","author_association":"CONTRIBUTOR","body":"I've investigated this issue a little and tried several methods of deep cloning ClientContext (serialization/deserialization with BinaryFormatter, mapping with AutoMapper, cloning with several libraries) and the only library/method that worked for me is [DeepCloner](https://www.nuget.org/packages/DeepCloner/). I can make a PR, but I don't know if using this library is acceptable. @jansenbe, what do you think?"}}
{"actor":{"display_login":"phawrylak"}}