microsoftgraph / msgraph-sdk-serviceissues

Tracks service issues for follow up.
5 stars 0 forks source link

OneDrive seems to lose Timezone of LastModified on Shared items. #66

Open ghost opened 6 years ago

ghost commented 6 years ago

Hey,

I'm currently writing a code to sync the shared items of a user OneDrive account into our Database.

We have shared an item on 12:34 PM Israel Standard Time, but when we get the information about the shared item over Dotnet Graph API we get it with the incorrect time. As it seems the timezone is not specified when converted to DateTimeOffset, therefore the given "LastModifedDateTime" is in the future.

This "bug" is also seen in the OneDrive Web Client - image As you can see in the attached image, the Last Modified Time is at 7:23 PM (local time), while I'm at 15:37 PM in real life (as seen on the clock of my computer). The OneDrive web client shows the future.

While debugging my code, I receive similar results. image When converted to local time using "ToLocalTime()" I'm getting the exact time I get on the OneDrive Web UI image


I am using Rider 2017.2 on a Net Standard 2.0

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

NuGet Package Version - Microsoft.Graph 1.6.2

Did anyone come to notice this "bug"? Any offers on how to handle it? I believe it will also occur in different time zones.

Edit - it seems that the problem occurs on the Graph Explorer as well. image

AB#7340

MIchaelMainer commented 6 years ago

Hello. Thank you for bringing this to our attention. Do you have Charles or some other capture tool? If so, can you provide a sanitized capture of the request and response?

From: Hagai Bloch [mailto:notifications@github.com] Sent: Wednesday, October 25, 2017 5:43 AM To: microsoftgraph/msgraph-sdk-dotnet msgraph-sdk-dotnet@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [microsoftgraph/msgraph-sdk-dotnet] OneDrive seems to lose Timezone of LastModified on Shared items. (#201)

Hey,

I'm currently writing a code to sync the shared items of a user OneDrive account into our Database.

We have shared an item on 12:34 PM Israel Standard Time, but when we get the information about the shared item over Dotnet Graph API we get it with the incorrect time. As it seems the timezone is not specified when converted to DateTimeOffset, therefore the given "LastModifedDateTime" is in the future.

This "bug" is also seen in the OneDrive Web Client - [image]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F32832019%2F31998979-59b975bc-b99a-11e7-9947-97427fe326e2.png&data=02%7C01%7Cmmainer%40microsoft.com%7Cd701192dbbde427cb8d408d51ba5f0f7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636445321883529561&sdata=z1zg6qN8o19ML3lvVpdg%2BWpQB7ioUHTLwTx%2B1HsLDzU%3D&reserved=0 As you can see in the attached image, the Last Modified Time is at 7:23 PM (local time), while I'm at 15:37 PM in real life (as seen on the clock of my computer). The OneDrive web client shows the future.

While debugging my code, I receive similar results. [image]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F32832019%2F31999091-c487667e-b99a-11e7-89b6-9f91d2e486dc.png&data=02%7C01%7Cmmainer%40microsoft.com%7Cd701192dbbde427cb8d408d51ba5f0f7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636445321883529561&sdata=4iV3yJfMV6boQeVD36KgFSauJB7gSIjADrT4v2vwOZE%3D&reserved=0

I am using Rider 2017.2 on a Net Standard 2.0

.NET Command Line Tools (2.0.0)

Product Information:

Version: 2.0.0

Commit SHA-1 hash: cdcd1928c9

Runtime Environment:

OS Name: Mac OS X

OS Version: 10.13

OS Platform: Darwin

RID: osx.10.12-x64

Base Path: /usr/local/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

Version : 2.0.0

Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

NuGet Package Version - Microsoft.Graph 1.6.2

Did anyone come to notice this "bug"? Any offers on how to handle it? I believe it will also occur in different time zones.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-dotnet%2Fissues%2F201&data=02%7C01%7Cmmainer%40microsoft.com%7Cd701192dbbde427cb8d408d51ba5f0f7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636445321883529561&sdata=55I2cA1rzbuBRu0SwIar24JNtTZea0n6LCYgjhpyvFI%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAIIdydbJsPvUAOpN2JCAuuYGGEppxjmzks5svyzagaJpZM4QF785&data=02%7C01%7Cmmainer%40microsoft.com%7Cd701192dbbde427cb8d408d51ba5f0f7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636445321883529561&sdata=nMWhvM%2F8qY482hb7clIU8Zw3d1%2FyQ6Yoe0%2B2o%2FsfpIo%3D&reserved=0.

ghost commented 6 years ago

Thank you for your response @MIchaelMainer, I took me longer than expected to get the information due to problems with Charles. I used Fiddler 4 on a Win 10 machine to capture the traffic.

Request:

GET https://graph.microsoft.com/v1.0/me/drive/microsoft.graph.sharedWithMe?$select=id,deleted,folder,name,createdDateTime,lastModifiedDateTime,location,shared,file,mimeType,parentReference,size,webUrl,permissions,remoteItem HTTP/1.1
Cache-Control: no-store, no-cache
Connection: Keep-Alive
Authorization: Bearer <TOKEN>
SdkVersion: Graph-dotnet-1.6.2
Host: graph.microsoft.com

Response

HTTP/1.1 200 OK
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
request-id: dd0ef1b8-1d4b-441e-b946-7130222c068f
client-request-id: dd0ef1b8-1d4b-441e-b946-7130222c068f
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"SouthEast Asia","Slice":"SliceB","ScaleUnit":"001","Host":"AGSFE_IN_7","ADSiteName":"SIN"}}
OData-Version: 4.0
Duration: 1581.1311
Date: Sun, 29 Oct 2017 09:32:32 GMT

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
    "value": [
        {
            "@odata.type": "#microsoft.graph.driveItem",
            "createdDateTime": "0001-01-01T00:00:00Z",
            "id": "0136T2DRCB72WHZ643IBBKFZSMFTU5O7QW",
            "lastModifiedDateTime": "2017-10Mr Sharer-25T09:23:00Z",
            "name": "Screen Shot 2017-10-09 at 3.51.18 PM.png",
            "parentReference": {
                "driveId": "b!WztLZPvFZkGtU6j4GPaW8RoqXflfjfZOhayHDvp4wc35x59lO8mbQK2GxDOvBCuN",
                "driveType": "business"
            },
            "webUrl": "https://privatedom-my.sharepoint.com/personal/fish_privatedom_com/Documents/Screen%20Shot%202017-10-09%20at%203.51.18%20PM.png",
            "file": {},
            "remoteItem": {
                "createdBy": {
                    "user": {
                        "email": "Fish@privatedom.com",
                        "displayName": "Mr Sharer"
                    }
                },
                "createdDateTime": "0001-01-01T00:00:00Z",
                "file": {},
                "fileSystemInfo": {
                    "createdDateTime": "0001-01-01T00:00:00Z",
                    "lastModifiedDateTime": "2017-10-25T09:23:00Z"
                },
                "id": "0136T2DRCB72WHZ643IBBKFZSMFTU5O7QW",
                "lastModifiedBy": {
                    "user": {
                        "email": "Fish@privatedom.com",
                        "displayName": "Mr Sharer"
                    }
                },
                "lastModifiedDateTime": "2017-10-25T09:23:00Z",
                "name": "Screen Shot 2017-10-09 at 3.51.18 PM.png",
                "parentReference": {
                    "driveId": "b!njVe0sGfAEGhBgzGPsnAtjlKMFrHVKJKvXBm8WGlEpfAlRcdQFP0RZPLbop3Pqj5"
                },
                "shared": {
                    "scope": "users",
                    "sharedBy": {
                        "user": {
                            "email": "Fish@privatedom.com",
                            "displayName": "Mr Sharer"
                        }
                    },
                    "sharedDateTime": "2017-10-25T09:24:00Z"
                },
                "sharepointIds": {
                    "listId": "1d1795c0-5340-45f4-93cb-6e8a773ea8f9",
                    "listItemId": "7",
                    "listItemUniqueId": "7cacfe41-9bfb-4240-a2e6-4c2ce9d77e16",
                    "siteId": "d25e359e-9fc1-4100-a106-0cc63ec9c0b6",
                    "siteUrl": "/personal/fish_privatedom_com",
                    "webId": "5a304a39-54c7-4aa2-bd70-66f161a51297"
                },
                "size": 0,
                "webDavUrl": "https://privatedom-my.sharepoint.com/personal/fish_privatedom_com/Documents/Screen%20Shot%202017-10-09%20at%203.51.18%20PM.png",
                "webUrl": "https://privatedom-my.sharepoint.com/personal/fish_privatedom_com/Documents/Screen%20Shot%202017-10-09%20at%203.51.18%20PM.png"
            },
            "size": 0
        }
    ]
}

As seen above, my Example is the Drive Item id "0136T2DRCB72WHZ643IBBKFZSMFTU5O7QW". Somehow, it was fixed for this file. The Last Modified time fits, no upgrade and no additional actions were made by our part.

EDIT

We just tried with another file and the problem came right back. The Last Modified Date is messed up

Request:

GET https://graph.microsoft.com/v1.0/me/drive/microsoft.graph.sharedWithMe?$select=id,deleted,folder,name,createdDateTime,lastModifiedDateTime,location,shared,file,mimeType,parentReference,size,webUrl,permissions,remoteItem HTTP/1.1
Cache-Control: no-store, no-cache
Connection: Keep-Alive
Authorization: Bearer TOKEN
SdkVersion: Graph-dotnet-1.6.2
Host: graph.microsoft.com

Response

HTTP/1.1 200 OK
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
request-id: 54d2897e-0be8-45d9-8e22-4999ac820172
client-request-id: 54d2897e-0be8-45d9-8e22-4999ac820172
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"SouthEast Asia","Slice":"SliceB","ScaleUnit":"000","Host":"AGSFE_IN_10","ADSiteName":"SIN"}}
OData-Version: 4.0
Duration: 896.617
Date: Sun, 29 Oct 2017 09:50:30 GMT

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
    "value": [
        {
            "@odata.type": "#microsoft.graph.driveItem",
            "createdDateTime": "0001-01-01T00:00:00Z",
            "id": "0136T2DRADVKNZK7NJT5EIJ6BETDLY7MND",
            "lastModifiedDateTime": "2017-10-29T16:49:00Z",
            "name": "Screen Shot 2017-07-04 at 6.22.12 PM.png",
            "parentReference": {
                "driveId": "b!WztLZPvFZkGtU6j4GPaW8RoqXflfjfZOhayHDvp4wc35x59lO8mbQK2GxDOvBCuN",
                "driveType": "business"
            },
            "webUrl": "https://company-my.sharepoint.com/personal/fish_company_com/Documents/Screen%20Shot%202017-07-04%20at%206.22.12%20PM.png",
            "file": {},
            "remoteItem": {
                "createdBy": {
                    "user": {
                        "email": "Fish@company.com",
                        "displayName": "Mr Fish"
                    }
                },
                "createdDateTime": "0001-01-01T00:00:00Z",
                "file": {},
                "fileSystemInfo": {
                    "createdDateTime": "0001-01-01T00:00:00Z",
                    "lastModifiedDateTime": "2017-10-29T16:49:00Z"
                },
                "id": "0136T2DRADVKNZK7NJT5EIJ6BETDLY7MND",
                "lastModifiedBy": {
                    "user": {
                        "email": "Fish@company.com",
                        "displayName": "Mr Fish"
                    }
                },
                "lastModifiedDateTime": "2017-10-29T16:49:00Z",
                "name": "Screen Shot 2017-07-04 at 6.22.12 PM.png",
                "parentReference": {
                    "driveId": "b!njVe0sGfAEGhBgzGPsnAtjlKMFrHVKJKvXBm8WGlEpfAlRcdQFP0RZPLbop3Pqj5"
                },
                "shared": {
                    "scope": "users",
                    "sharedBy": {
                        "user": {
                            "email": "Fish@company.com",
                            "displayName": "Mr Fish"
                        }
                    },
                    "sharedDateTime": "2017-10-29T09:49:00Z"
                },
                "sharepointIds": {
                    "listId": "1d1795c0-5340-45f4-93cb-6e8a773ea8f9",
                    "listItemId": "8",
                    "listItemUniqueId": "959baa03-a97d-489f-84f8-2498d78fb1a3",
                    "siteId": "d25e359e-9fc1-4100-a106-0cc63ec9c0b6",
                    "siteUrl": "http://fundamental_donotdelete_d3c40019-13a4-4fd0-a3ef-e1e4b169ab41",
                    "webId": "5a304a39-54c7-4aa2-bd70-66f161a51297"
                },
                "size": 0,
                "webDavUrl": "https://company-my.sharepoint.com/personal/fish_company_com/Documents/Screen%20Shot%202017-07-04%20at%206.22.12%20PM.png",
                "webUrl": "https://company-my.sharepoint.com/personal/fish_company_com/Documents/Screen%20Shot%202017-07-04%20at%206.22.12%20PM.png"
            },
            "size": 0
        }
    ]
}

As We can see Drive Item - 0136T2DRADVKNZK7NJT5EIJ6BETDLY7MND has a LastModifiedTime in the Future "2017-10-29T16:49:00Z", this is also seen in the Web UI.

image

MIchaelMainer commented 6 years ago

@hgbloch Thank you for sharing this. There is something strange going on here. I'm going to pass this information on to the folks that own the service side of this.

ghost commented 6 years ago

Hey @MIchaelMainer, the problem seems to be back (it was working for a long time)

MIchaelMainer commented 6 years ago

@hgbloch I'll escalate this again. Thank you.

petrhollayms commented 4 months ago

Thank you for reporting this issue. This appears to be an issue or limitation with the service APIs. Unfortunately, as the Microsoft Graph SDK team, we do not have ownership of the APIs that are causing you issues. We invite you to create a question about the service API to Microsoft Q&A and tagged with one of the [microsoft-graph-*] tags, that way it will get routed to the appropriate team for them to triage:

https://aka.ms/msgraphsupport or directly https://aka.ms/askgraph

For now, we will close the issue on our side but feel free to open it in the relevant repository if you think the issue is specific to SDK. Please let us know if this helps!

Note: We will close this repository on April 19, 2024.