Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Describe the bug / error
For a given tenant property which has been updated multiple times, whenever we try to retrieve a tenant property using REST API, it returns different output (including previously stored values).
In other words, multiple requests to https://<tenant>.sharepoint.com/sites/<web>/_api/web/GetStorageEntity('key') REST API yields inconsistent results.
Additional Observation
- This problem occurs even after we disabled browser-level caching of Network requests.
- It should be noted that this issue occurs only when you use REST API to retrieve tenant properties. Using Get-PnPStorageEntity cmdlet, it always gives me the latest (correct) value.
Perhaps could this be an issue with multiple front-end servers processing my request? And the fact that tenant properties are cached on front-end servers for optimization. So whenever it's value is updated, it is not synced instantaneously across available servers and hence the issue.
Steps to reproduce
- Connect to your SharePoint Online tenant using PnP PowerShell.
- Set tenant property using PnP cmdlet.
Set-PnPStorageEntity -Key "Country" -Value "Finland"
- Log-in to your tenant in browser and open a new tab and enter the following URL and check the response:
https://<tenant>.sharepoint.com/sites/<web>/_api/web/GetStorageEntity('Country')
- Then update the tenant property with a different value using PnP cmdlet.
Set-PnPStorageEntity -Key "Country" -Value "India"
- Refresh the URL (mentioned above in step-4) multiple times and notice the inconsistency in values yielded by the REST API. Sometimes it returns
India, other times Finland. And at times even null is returned.
Expected behavior
- Tenant properties yielded by REST API are consistent.
- It always returns the latest value of the requested tenant property.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Describe the bug / error
For a given tenant property which has been updated multiple times, whenever we try to retrieve a tenant property using REST API, it returns different output (including previously stored values).
In other words, multiple requests to
https://<tenant>.sharepoint.com/sites/<web>/_api/web/GetStorageEntity('key')REST API yields inconsistent results.Additional Observation
Perhaps could this be an issue with multiple front-end servers processing my request? And the fact that tenant properties are cached on front-end servers for optimization. So whenever it's value is updated, it is not synced instantaneously across available servers and hence the issue.
Steps to reproduce
Set-PnPStorageEntity -Key "Country" -Value "Finland"https://<tenant>.sharepoint.com/sites/<web>/_api/web/GetStorageEntity('Country')Set-PnPStorageEntity -Key "Country" -Value "India"India, other timesFinland. And at times evennullis returned.Expected behavior