Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
travelmarx opened this issue Nov 13, 2023 · 20 comments
Open

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

travelmarx opened this issue Nov 13, 2023 · 20 comments

Comments

@travelmarx
Copy link

travelmarx commented Nov 13, 2023

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
@travelmarx travelmarx changed the title Change in what the File Picker shows by default File Picker does show "My files" without refresh Nov 14, 2023
@codenamegary
Copy link

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
Copy link

jviney commented Nov 15, 2023

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
Copy link

seoly0 commented Nov 16, 2023

@codenamegary
Copy link

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

@jviney
Copy link

jviney commented Nov 16, 2023

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
Copy link
Author

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

  • A left pane "Pick Items" has just "Recent" and "Photos" and the right pane has "My Files" content (files and folders) correctly displayed.
  • If I refresh the file picker window (CTRL + R), "My Files" gets added to the "Pick Items" (left pane) and then "something went wrong" message appears in the right pane.
  • If I then sort the right pane, "My Files" content shows up correctly.

@bbonamin
Copy link

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

@PashaPash
Copy link

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

@travelmarx
Copy link
Author

My experience same as PashaPash.

@travelmarx
Copy link
Author

travelmarx commented Dec 16, 2023

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
Copy link
Collaborator

JCrew0 commented Jan 9, 2024

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

@JCrew0 JCrew0 closed this as completed Jan 9, 2024
@travelmarx
Copy link
Author

travelmarx commented Feb 8, 2024

@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
Copy link

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
Copy link

@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
Copy link

adri1wald commented Mar 19, 2024

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?

@JCrew0 JCrew0 reopened this Mar 20, 2024
@travelmarx
Copy link
Author

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

@markbeau
Copy link

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

@travelmarx
Copy link
Author

travelmarx commented May 24, 2024

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
Copy link
Author

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

@andrew-arkhipov
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests