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

Inconsistent File Viewing/Rendering via auto-library reload (RenderListDataAsStream) #9930

Open
1 of 9 tasks
chrisredman01 opened this issue Sep 20, 2024 · 0 comments
Open
1 of 9 tasks
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@chrisredman01
Copy link

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

other (enter in the "Additional environment details" area below)

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version Chrome 128.0.6613.138
  • SharePoint Modern Experience

Describe the bug / error

We are using the Graph API / CSOM to effectively replace an existing file with a stub/link file.

This uses the following Graph API endpoints:

  • Renames "Filename.docx" to "Filename.docx.url"
    PATCH /drives/{drive-id}/items/{item-id} (docs)

  • Replaces the file content with the URL Shortcut contents
    PUT /drives/{drive-id}/items/{item-id}/content (docs)

  • Deletes all previous version history via CSOM ListItem.Versions.DeleteAll()

We observe that the Document Library does a reload of the contents and shows the updated file.

However, clicking to view the file behaves differently until the full browser page is refreshed.

For example, the URL file is treated as a file download by the browser. After a page refresh, clicking the URL file will correctly navigate to the URL within the file (desired behaviour).

Url

The same can be seen for a 'txt' file. It is passed off to be rendered by the browser (e.g. displayed in a new tab). After a page refresh, clicking the 'txt' file results in it opening within the SharePoint Text viewer/editor.

Txt

Steps to reproduce

  1. Add an Office document to a library
  2. Call the Graph API to rename the file to a different format i.e. {Filename}.url
  3. Call the Graph API to replace the file contents i.e. the .url content
  4. Wait for the Document Library to reload automatically
  5. Click the file and observe the rendering is handled by the browser
  6. Refresh the page and click the file
  7. Observe the rendering is handled by SharePoint (desired) e.g. the URL shortcut is followed, or the txt file opens within the editor dialog.

Expected behavior

Ideally the behaviour would be consistent, and handled by SharePoint rendering.

@chrisredman01 chrisredman01 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

1 participant