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

Shared Links Break in SharePoint After File Relocation #64

Open capedrolima opened 10 months ago

capedrolima commented 10 months ago

Describe the bug The shared link stops functioning when a user moves a file from one site to another in SharePoint. Originally, the link is obtained through the file picker (webUrl from the json), but after moving the file, the link no longer works.

To Reproduce Steps to reproduce the behaviour:

  1. Attach a file using the file picker
  2. Save
  3. Go back to SharePoint and move the file from the original Site to another one (group/site etc)
  4. Attempt to access the file via the previously obtained shared link from the file picker.
  5. Notice that the link no longer functions.

Expected behaviour I expected the shared link to continue working after the file was moved from one site to another within SharePoint. This would allow for continuous access to the file regardless of its location within SharePoint.

BUT we are open to alternatives, for example. It could be possible to add metadata to the json? Today we have the DocumentID, that will never change. Microsoft documentation

Details I am trying to ensure that shared links remain functional even after files are moved within SharePoint. This is crucial for maintaining constant access to files by users who depend on these links. I would like to know if there is a way to keep the shared link functional after a file is moved, or if there is a unique file ID that remains constant and can be used to perform searches, even after the file is moved.

Example New Location.json Original Location.json