OneDrive / samples

Contains samples, scenarios, and guidance for integrating with OneDrive and SharePoint drives, drive items, and files.
MIT License
58 stars 59 forks source link

File Picker does show "My files" without refresh #61

Open travelmarx opened 1 year ago

travelmarx commented 1 year ago

Hi, we've been using OneDrive File Picker v8 now for over 6 months just fine (for the most part). However, starting a few weeks ago, something changed.

With our setup, after calling the picker, we used to see: "My files, Recent, and Photos".

But a few weeks ago - with no changes in our code - we started seeing just "Recent and Photos". (see image 1)

Then we figured out if we refreshed the popup window (CTRL R) then "My Files" would show up but still have a "something wrong". (image 2)

Clicking "My Files" would then show our files and we could then pick files as normal. (image 3)

And sometimes, at this point we still get "something wrong" and then if we change sorting, everything appears as expected.

Has something changed? Thanks!

Image 1 - Missing "My files"

image 1

Image 2 - "My files" shows up after refresh

image 2

Image 3 - finally "My files" content shows up after clicking "My files"

image 3
codenamegary commented 1 year ago

I'm working on a new implementation and I've observed the same thing. It seems like it's been working only intermittently for the last several days, even the sample projects have stopped working for me several times.

jviney commented 1 year ago

We've noticed the same thing recently too. When the v8 picker opens in an iframe we see console errors.

There is a request to https://api.onedrive.com/v1.0/drives/unauth/items/root?%24expand=thumbnails which fails. If you replace "unauth" in the url with "me" and replay the request it succeeds.

image
seoly0 commented 1 year ago

I had a similar issue as well. try this https://stackoverflow.com/questions/77457558/problem-connecting-to-onedrive-file-picker-v8/77492041#77492041

codenamegary commented 1 year ago

@patrick-rodgers @jansenbe - Any ideas here? Seems like a few people are struggling to get even a basic sample working.

jviney commented 1 year ago

The Stack Overflow post got things working for me. The cid value comes from the oid claim in the id token. It's formatted as a uuid, but just remove the dashes and only use the last half of the string. Eg: idTokenClaims.oid.replace(/-/g, "").slice(16).

travelmarx commented 12 months ago

Thanks, that improves things a bit, but still seeing odd behavior. With cid value and opening file picker I see the following:

bbonamin commented 12 months ago

I can confirm we have the same issue, of files not appearing, which was fixed by setting cid: {VALUE} as described here

PashaPash commented 11 months ago

Same for me, fix allows files to be displayed on the right side, but still no "My Files" section on the left.

travelmarx commented 11 months ago

My experience same as PashaPash.

travelmarx commented 11 months ago

As of the last few days, "My Files" is working as expected. It is appearing in the left pane, and everything is working as expected. I wish I knew what changed. (Now, to get Photos working #27 :-)).

JCrew0 commented 10 months ago

@travelmarx Glad to hear this was fixed! I think a fix was made internally by one of the engineers on my team.

travelmarx commented 9 months ago

@JCrew0 - argh, the issue seems to be back with My files. See attached image. If I sort, files show up. A refresh doesn't help. So, I can continue working but it's not optimal behavior.

I'll add, I haven't change config parameters or code.

My file not working even with refresh
saadumerhashmi commented 9 months ago

I am facing the same issue, it was working before but now its giving errors sometime its "something went wrong" and sometimes its "items might not exists".

I have noted one thing if, I remove messaging: { channelId: cid, origin: "http://localhost:8000/customer/upload" },

it seems to work on a refresh, but with broken functionality. I am doing it for consumers. cap

codenamegary commented 9 months ago

@JCrew0 - Is your team actively working on any of these? Is this a supported integration? I have indefinitely backlogged this work for my teams because it just seems like there's no priority on a fix.

adri1wald commented 8 months ago

It's because the initial URL for getting the files has a bad query param:

https://api.onedrive.com/v1.0/drives/REDACTED/items/root/children?%24top=30&orderby=folder%2CsavedSortFieldValue&%24expand=thumbnails%2Clenses%2Ctags&select=*%2Cocr%2CwebDavUrl%2CsharepointIds%2CisRestricted%2CcommentSettings%2CspecialFolder%2CcontainingDrivePolicyScenarioViewpoint

savedSortFieldValue is not valid. if you replace it with name, fileSystemInfo%2FlastModifiedDateTime, or size the request works (or just change the sort order in the UI). can someone at microsoft please fix this?

travelmarx commented 8 months ago

Looks like it's working....just noticed and will keep testing a bit. Thank you!

markbeau commented 7 months ago

I can confirm as well that the picker is now working properly in my apps. Thanks for your attention and work on this.

travelmarx commented 6 months ago

Oops, started acting up again today = open file picker and get "Something went wrong" (see attached). Then with focus on "My files" changes something like name sorting and then content appears as expected. No code changes on my part, i.e., I've been using the same code since before the start of this issue. Thanks.

Picker error
travelmarx commented 5 months ago

Seems to have resolved for now. Is there something we can do (set in config) to be immune to this problem ?

andrew-arkhipov commented 2 months ago

I'm experiencing this issue now, where a reload works 10% of the time but the remaining 90% fail indefinitely. Getting the following message every time in the failure case:

code: "unauthenticated"
message: "Authentication failed"
isExpected:  false
message: "Authentication failed"
notification: "page-loaded"

I have verified that I'm authenticated. Perhaps I have some race condition in my code that I'm not aware of, but I'm following the docs pretty closely and making sure that I'm not calling any requests until the msal instance has been properly initialized.