Saturday, July 30, 2016

SharePoint O365!! Why I see all my site contents are updated at once a few hours ago?

Most of the sites, I've been working with, have not been updated in the recent past. However, one fine day I opened the site content and all the lists and libraries were showing the content was modified a few hours ago. It was not a big deal at that time to figure it out what was the reason behind those 'all of a sudden & all at once' updates. Anyhow, it is time now to see what's going on. Then I found a SPUser Voice shouting at Microsoft about the same issue( reflect the content changes not the system changes). This article is to present some findings about the 'Unexpected Modified Dates'. And one of the factors being the REST Query. PFB, the screenshot..

Recently when I retrieved a list item, I found three different date attributes came along as highlighted below.

<entry xml:base="http://ift.tt/2aEFKm3"...>
<id>e11700c1-97d3-4451-8544-0bd6d1e4c995</id>
<category term="SP.Data.TestFormListItem" scheme="http://ift.tt/1aFoa69" />
<link rel="edit" href="Web/Lists(guid'e743b81c-0245-4970-a87d-9692d42813cc')/Items(<ID>)" />
<title />
<updated>2016-07-20T19:58:50Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Modified m:type="Edm.DateTime">2016-06-20T12:35:20Z</d:Modified>
<d:Created m:type="Edm.DateTime">2016-05-31T11:33:56Z</d:Created>

</m:properties>
</content>
</entry>


Created : Attribute of the content, tells when the item/document is created
Modified : Attribute of the content, tells when the item/document's metadata is last modified
Updated : Attribute of the list item, tells when the list item is last updated.
Now, More Insight...

Before the REST Query

As we can see in the below image, the given lists were updated at the same time.

Then I though of observing which REST query is triggering the mysterious update mechanism. Then this happened...

And then this...

At this point, after observing it for multiple times I came to an understanding that every first time the items are retrieved by using REST query, the date value is getting updated. Since all the above requests are get requests, I tried to access the same resources from the site contents. However, accessing so didn't update the modified date.

I'm really ambiguous about making any further comments on this behaviour and Microsoft's thinking about how this 'Updated' is more useful than 'Modified' time. However, whatever is the intention of Microsoft, presenting it as the last modified date to the user is so confusing/miss-leading. And it raises questions about the integrity of the product.

Interesting thing is this behaviour occurs only with REST queries. I tried the below things as well..

Click on link title and open an item
Managed client object model code equivalent to "/items"
However, the "updated" property of the list object didn't get updated. Final words...

The modified date, for lists, we see in the site contents is getting updated when a user accesses the "items" using REST query (using either code or directly hitting the url in browser's address box) for the First Time - So is it for analysing the REST activities of unique uses on the list? Nay, doesn't make sense.

However, it's not just about the REST calls - It is one of the reasons. There must be multiple reasons causing this behaviour.

Riddles here :

What is the use of the "Updated" property?
Somehow, I figured out one way that is causing the "Modified" date change for lists. And the question is, what is causing the change in "Modified" dates of libraries & other objects?


ORIGINAL Post
by Saratchandra Peddinti via Everyone's Blog Posts - SharePoint Community

No comments:

Post a Comment