Skip to content

SharePoint Online PermMask cached wrong in Local Browser Storage / Service Worker #9358

@chr-sad

Description

@chr-sad

Target SharePoint environment

SharePoint Online

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

SharePoint REST API

Developer environment

Windows

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

No response

Describe the bug / error

I am not sure, if this is the correct Issue-List to post this topic since it's about the SharePoint Online client side caching / API issue. We build solutions using PnP/Js (SharePoint Rest API) and use the "PermMask" information on ListItems for permission information.

Simplified calls like:

  const folderItem = await webRef.getFolderByServerRelativePath(folderServerRelativeUrl).getItem()
  const folderItemData = await folderItem.select('Id, UniqueId, PermMask').get()

In the Network-Tab we can see the request handled by SharePoint correctly without error, but the PermMask returned is not correct. E.g. the user has Permissions to upload documents to this specific folder if we have a look in SharePoint directly (UI) but if we check the permission mask, it says, the user has only read permissions.

If we then press F12 > clear the whole cache (incl. service worker) with "Application" > "Storage" > "Clear site data" and only refresh the page (no code changes) we do get the correct PermMask and everything is working again.

This issue is happening for multiple users in multiple tenants now, but not reproduceable (at least for us) and reoccuring over time even if we removed the cache once.

Is anyone experiencing the same issues?

Steps to reproduce

We cannot finally reproduce this issue in steps. The only thing which is the same for all effected users that the only solution is to clear the cache incl. service worker.

Expected behavior

If the service worker is caching the list item incl. PermMask it should handle the update of the cache correctly in every case (e.g. even if the permissions are updated by Rest API calls as well)

Metadata

Metadata

Labels

Needs: Attention 👋Original poster responded to request for feedback, awaiting attention from Microsoft / community.area:spfxCategory: SharePoint Framework (not extensions related)sharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions