sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

SPFX webpart serving old files versions in Chrome

Open Ryan365Apps opened this issue 4 years ago • 50 comments

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

Windows

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

  • [ ] 💥 Internet Explorer
  • [X] 💥 Microsoft Edge
  • [X] 💥 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 Google Chrome - Version 97.0.4692.99 (Official Build) (64-bit) Microsoft Edge - Version 97.0.1072.62 (Official build) (64-bit)
  • SPFx version 1.12.1
  • Node.js version 10.13

Describe the bug / error

I'm facing a strange error where SPFX web part is serving an old version of the CDN files when using a standard refresh in chrome but works fine when doing a hard reload.

The problem appears again if another standard refresh is shown.

Gif showing the same page in both browsers side by side.

RefreshExample

**Important to note that this has been reported to have occurred across a number of my customer's Production tenants and I can provide the details of those privately.

I believe this is similar to this issue SPFx loading old version files and sometimes from different environment #7008

Apologies if more information is needed on build/environment etc but my assumption is that this isn't a specific config of my setup.

Thanks

Steps to reproduce

  1. Add custom web part in Chrome & Edge

Expected behavior

Same consistent experience in Chrome and Edge

Ryan365Apps avatar Jan 21 '22 10:01 Ryan365Apps

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jan 21 '22 10:01 ghost

The same situation in one tenant 2 days ago and today in another tenant ((

The same situation in one tenant 2 days ago and today in another tenant ((

Adding details: one tenant is using O365 CDN, another one just uses app catalog for assets

From #7662:

have checked that recently on some of the tenants my spfx packages are returned to their initial versions, due to this their functionality also showing which I implemented and deployed in first version and everything which I deployed in my latest versions are vanished. It reflects on some of the tenants for me. My current version is 1.0.0.2 but on app catalog is changed to 1.0.0.1. It happened with my all .sppkg packages on multiple tenants also. Right now I resolved it by re-deploying my latest packages on the app catalog for all tenants.

AJIXuMuK avatar Jan 21 '22 14:01 AJIXuMuK

Had tried that with no success. My example above shows exactly the same site page open in two browsers, so the deployed package is the same.

It seems that the older files are persisting in the cache storage, and the standard refresh is still serving those cached files - I compared this with files served via "empty cache and hard reload" and all the metadata was identical, but the content was different.

I resolved this for one of my dev tenants by manually finding the entry in the cache of chrome and deleting the file.

I can't do this for over 40 customer tenants so I'm hoping for a better resolution

image

Ryan365Apps avatar Jan 21 '22 14:01 Ryan365Apps

Our company's tenant experienced a similar issue this morning. All custom SPFX developed web parts reverted back to the first version that was uploaded to our tenant's SharePoint app catalog. The old version of the webpart showed in Edge, Chrome and Firefox. Emptying the cache did not resolve it. The SharePoint app catalog correctly shows the latest version number (i.e. 1.9, 1.12, etc) of each web part, but the actual version that loads on SharePoint is v1.0.

For the webparts deployed tenant-wide, I was able to go to the SharePoint app catalog, click one of the web parts, then click "Deploy" at the top and the latest version appeared immediately in SharePoint. Which begs the question: why did they revert to the initial version to begin with?

tandy-1000-hx avatar Jan 21 '22 15:01 tandy-1000-hx

This is all super weird. For people that are facing this, can you go to the manifests list (sites/appcatalog/Lists/ComponentManifests/) and find the components that are misbehaving? If you look at the ComponentManifest, there should be a path property that has the name of the js file. Is that correct (pointing at the new version) or incorrect (pointing at the old one)? Additionally, if you go to the appropriate folder in sites/appcatalog/ClientSideAssets and drill into your solution, are the new or old files there?

Finally, can you look at the version history of these and see if something edited / updated them?

Additionally, how "old" are the original versions compared to the new ones? Did they revert from yesterday, or from months ago, or ??

patmill avatar Jan 21 '22 17:01 patmill

Deleted some messages now that I know what happened. An upgrader was written against the app catalog, and it triggered a redeploy of all the solutions. However, for those of you that have too much knowledge of SharePoint, you know that the upgrader will run as system, and the system account has access to minor and major versions, but not checked out ones. So the effect of this is that the latest checked in version has been redeployed, overwriting the contents of the componentmanifests and clientsideassets libraries.

There is a fix being made to clean this up for everyone, redeploying the checked out content.

In the meantime, the workaround for this (as far as I can tell) is to find all the solutions that are checked out (green accent on the icon) and if they are deployed, check them in. This will cause them to redeploy the latest versions.

Additionally, the ability to have checked out versions in the app catalog should be either a) removed or b) you need to check them in before you can deploy them.

There should be wide comms on this posted in the admin portal I believe.

patmill avatar Jan 21 '22 23:01 patmill

@patmill , thank you for following up and for the acknowledgement and explanation of the issue! I was going in circles trying to figure out how it happened. I see Microsoft has now sent out a bulletin for it in the tenant's Service Health admin center. Thanks again for following up!

tandy-1000-hx avatar Jan 24 '22 14:01 tandy-1000-hx

Hi,

We're experiencing this same issue on a bunch of tenants, but our issue seems to be targeted more on library components and re-deploying doesn't resolve it.

We load our library components using SPComponentLoader.loadComponentById() and this was working fine until we noticed this bug yesterday. Even with fresh deployments of the library component sppkg files it persists (I even tried deleting them entirely and re-deploying).

On a cold load, no cache, they are loaded just fine. Subsequent page loads from cache and the SP component loader can't find the manfiests (just comes back null).

Could there be a separate issue with library components missing from cache when using the SPComponentLoader? Older tenants where we had previously deployed these packages are loading ok. It seems to be tenants we've spun up in the last week or so that are experiencing this issue.

Thanks!

mbice avatar Jan 26 '22 18:01 mbice

We are still experiencing this issue - one of my developer tenants and a customer's production tenant (tenant details available if needed).

As @mbice states "cold load, no cache" works fine but any other page load uses much older cached content. Checked in and re-deployed solution does not work.

The admin center message SP316684 is stated as "service restored"

Ryan365Apps avatar Jan 26 '22 23:01 Ryan365Apps

We're seeing this issue spread to more tenants and not just new ones we've created in the past few weeks. Not sure if re-deploying packages is triggering the library component cache load issue or if it's happening automatically.

@patmill is the library component part of this issue known on your side yet?

mbice avatar Jan 27 '22 19:01 mbice

To help diagnose, can you try hitting your page with ?sw=bypass and see if the problem goes away?

patmill avatar Jan 27 '22 19:01 patmill

@patmill adding ?sw=bypass on page load does make the problem go away, but then it persists again on subsequent page loads once the querystring parameter is removed.

Thanks!

mbice avatar Jan 27 '22 19:01 mbice

To help diagnose, can you try hitting your page with ?sw=bypass and see if the problem goes away?

@patmill Tried your suggestion and the problem is resolved when adding ?sw=bypass but when reloading the page the problem is back since the querystring is removed.

sherpas-par avatar Jan 28 '22 09:01 sherpas-par

can reproduce this issue in both, standard and targeted release.

CTRL+F5 or ?sw=bypass is "healing" the issue for one load cycle.

till-llit avatar Jan 28 '22 10:01 till-llit

This effected also our production tenant since yeaterday mid-night.

@patmill We checked our versions in ComponentManifests and also Clientsideassets. They look fine. I also did re-deployment in our dev Environment where we have similar issue, it didnt help us. Any hints please how we dig further.

arunakshi avatar Jan 28 '22 12:01 arunakshi

Just to update the thread. The team has made fixes that should unblock these scenarios. They will be rolled out WW in the next 2 weeks. Additionally what you could to to unblock right now:

  • Return Access-Control-Expose-Headers: Date to allow service worked read the headers for the pre-flight
  • set cache-control to no-cache,max-age=0

This should unblock you.

AJIXuMuK avatar Jan 28 '22 14:01 AJIXuMuK

Could you elaborate on where we have to add this work around ?

desaiprerak avatar Jan 28 '22 14:01 desaiprerak

These should be response headers for you custom CDN location.

AJIXuMuK avatar Jan 28 '22 15:01 AJIXuMuK