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

ListView Command Set extension suddently stopped working - only loads when page is refreshed with Ctrl+F5

Open JLRishe opened this issue 1 year ago • 43 comments

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

None

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

  • [ ] 💥 Internet Explorer
  • [ ] 💥 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

  • Chrome 128.0.6613.85
  • 1.13.1

Describe the bug / error

I am the maintainer of a SPFx package that is used in a few dozen customer tenants and contains a List View Command Set extension, a Field Customizer extension, and a web part.

Two days ago, one of my customers who has been using this package for about this year reported that the List View Command Set button had suddenly stopped displaying on multiple list pages (possibly all of the list pages where it is in use).

I have met with him to troubleshoot and observed the following:

  • The extension displays without issue on Library View pages, but has an issue on List View pages.
  • It displays without issue in modern List View webparts, even for the same lists where it fails to display on their regular List View page.
  • If he refreshes the page with Ctrl+F5, the Command Set button displays and works correctly. But if he then refreshes the page normally, or navigates away and returns to the page, it again fails to display. The only time it displays is when the page is loaded with Ctrl+F5.
  • The Field Customizer extension from the same package is working fine, even on the pages where the Command Set is having an issue.
  • The Web Part from the same package is working fine, but it is not used on list view pages.
  • The browser console doesn't seem to show anything pertaining to the Command Set. There are no error messages about it (or coming from it) when it fails to load, and there is no mention of it when it loads successfully. By contrast, there are log entries indicating that the Field Customizer loaded.
  • There are a few differences in the console output during a successful load vs. unsuccesful load:
    • When loading the page in such a way that the Command Set fails to load, there is a log line from deferred.js indicating "1526 install done". When loading with Ctrl+F5, there isn't.
    • There is a "Not one page nav, start prefetch" log line that appears further down in the list of console entries when loading with Ctrl+F5 vs loading normally.
  • The Network tab of the browser tools shows the SPFx package's script files being retrieved differently depending on how the page is loaded.
    • When loading with Ctrl+F5 the package's script files are retrieved and the Initiator column is blank
    • When loading without Ctrl+F5, the packages script files are retrieved twice - once with sp-loader-assembly as the Initiator and once with AllItems.aspx as the initiator. In both cases, the Fulfilled By column indicates (Service Worker)
  • This issue does not currently reproduce in my tenant, and none of my other customers have reported this issue, though I'm not sure how many of them are using this Command Set on a List page since using it on a Library page is more common.

What can I do to troubleshoot or remedy this issue?

Console when Command Set fails to load

Not loading console markup

Console when Command Set loads

Loading console markup

Network requests when Command Set fails to load

image

Network request when Command Set loads

Loading requests

Steps to reproduce

Currently I only know this to reproduce in my customer's environment.

  1. Navigate to a list page that has the Command Set extension configured
  2. View the command bar

Expected behavior

The Command Set button should display.

JLRishe avatar Aug 30 '24 09:08 JLRishe

I am seeing the same thing with a Command Set Extension that was developed with SPFX 1.13.1. This is a project that was working fine for years. But with the new SharePoint List UI that the tenant recently got, the buttons are no longer visible.

I tried to troubleshoot by creating a new Command Set HelloWorld Extension using the MS Learn example and spfx 1.13.1: https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api

When I try to gulp serve or gulp bundle, this error is thrown: AppData\Roaming\nvm\v14.15.4\node_modules\gulp-cli\bin\gulp.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (C:--\command-extension\node_modules@azure\logger\dist\commonjs\log.js:7:19) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) { code: 'MODULE_NOT_FOUND',

If I update to spfx 1.19.0 and npm 18.19.1 to create the MS Learn Example, I am able to package and deploy without an issue. The Command Set buttons appear as expected.

Can someone run a similar test with spfx 1.13.1?

Marker4 avatar Sep 04 '24 21:09 Marker4

We are seeing the same issue since the forced rollout of the new Lists experience. However, even Ctrl + F5 does not consistently allow the Command Sets to load, only some of multiple tries succeed.

Same as your description we're seeing that other extensions, deployed in the same app package, are loading successfully. Even initialization logs of Command Set extensions do not show up in the console at all.

Really hope there will be a quick fix/rollback for this. It's very frustrating there's nothing we can do to rollback or fix the issue, especially since it's clear from earlier issues that there have been many lingering issues with the new Lists experience.

gerkevgarderen avatar Sep 05 '24 08:09 gerkevgarderen

I see the same behavior where the Command Set Extension does not load until you do a hard refresh.

Turning off Sync under Microsoft Lists (Waffle icon in top left corner > Lists > Hover over the list and click ... > Turn off Sync) fixes the issue, but from what I can see this setting is personal and there is no method to turn this off on a list for all users.

It doesn't seem to be the same setting that you can find in List settings > Advanced settings > Offline Client Availability > Allow items from this list to be downloaded to offline clients. From what I can see, turning off this setting does not make any difference.

Please fix!

Alexander

SPJS avatar Sep 05 '24 14:09 SPJS

Thanks folks. We are aware of and working on an issue where command sets don't load when a list is syncing. As mentioned in this thread, the workaround for now is to stop syncing on the list.

reedpamsft avatar Sep 05 '24 15:09 reedpamsft

Can someone provide more information on this workaround? I don't see the ability to turn off syncing as described for MS Lists.

We are using SharePoint Online. Both lists have "Allow items from this list to be downloaded to offline clients?" set to "No" which has made no difference on our end. Hard Refresh (Ctrl + F5) is also not working to get the Command Sets to display.

While it is great that there is a workaround that is working for some people, it does not appear to be working for all. It is not working on my client's tenant.

Please test with a Command Set created with SPFX 1.13.1

Marker4 avatar Sep 05 '24 16:09 Marker4

If you click the Waffle icon (the 9 dots icon) in the top left corner of your SharePoint site you should see a "Lists" icon. Click it and you should see your list under "Recent lists". Hover over the list, click the ... icon and click "Stop syncing".

Alexander

SPJS avatar Sep 05 '24 17:09 SPJS

@SPJS I did try to follow your prior instructions. I'm just not seeing it on either site I am looking at: MSListSettingsExample

Marker4 avatar Sep 05 '24 18:09 Marker4

@SPJS I did try to follow your prior instructions. I'm just not seeing it on either site I am looking at: MSListSettingsExample

Same here. I dont see the option to "Stop syncing".

keraaj1980 avatar Sep 05 '24 18:09 keraaj1980

Thanks folks. We are aware of and working on an issue where command sets don't load when a list is syncing. As mentioned in this thread, the workaround for now is to stop syncing on the list.

Workaround is not working for everyone. Please fix!

keraaj1980 avatar Sep 05 '24 18:09 keraaj1980

@SPJS I did try to follow your prior instructions. I'm just not seeing it on either site I am looking at:

Same here; 'Stop Syncing" is available for some lists, but for the lists where we have CommandSets deployed, this option is not available.

It doesn't seem to be the same setting that you can find in List settings > Advanced settings > Offline Client Availability > Allow items from this list to be downloaded to offline clients. From what I can see, turning off this setting does not make any difference.

The value of this setting also does not impact the issue for us. I have checked sites where this was already on 'Off' for a longer time, but no luck. Sites with the setting "On" in many cases still don't show the Stop Syncing. All of the sites do not consistently load CommandSets (Ctrl+F5 sometimes causes it to render, still not consistently).

Seems to me like it's not necessarily related to the Syncing.

gerkevgarderen avatar Sep 05 '24 18:09 gerkevgarderen

@gerkevgarderen there is another issue reported in a different thread where certain deprecated API's are not currently supported in the new UI, so you might be seeing that.

reedpamsft avatar Sep 05 '24 19:09 reedpamsft

@gerkevgarderen there is another issue reported in a different thread where certain deprecated API's are not currently supported in the new UI, so you might be seeing that.

@reedpamsft - Do you have any updates on the fix? The workaround doesn't seem to work on my end,

keraaj1980 avatar Sep 05 '24 20:09 keraaj1980

@Marker4 @keraaj1980 @gerkevgarderen I found an older article (from 2022 - link) mentioning that different “complex” field types like lookups or managed metadata will stop syncing of that list. Microsoft has most likely changed the functionality since that article, but I assume it might be something like that preventing you from finding the “stop syncing” option.

Alexander

SPJS avatar Sep 05 '24 20:09 SPJS

@Marker4 @keraaj1980 @gerkevgarderen I found an older article (from 2022 - link) mentioning that different “complex” field types like lookups or managed metadata will stop syncing of that list. Microsoft has most likely changed the functionality since that article, but I assume it might be something like that preventing you from finding the “stop syncing” option.

Alexander

Thanks for sharing the link, @SPJS!

I don't have a managed metadata column or a lookup column on one of the lists and I still don't see the option to "stop sync" option.

keraaj1980 avatar Sep 05 '24 20:09 keraaj1980

@reedpamsft - Do you have any updates?

keraaj1980 avatar Sep 05 '24 20:09 keraaj1980

@Marker4 @keraaj1980 @gerkevgarderen I found an older article (from 2022 - link) mentioning that different “complex” field types like lookups or managed metadata will stop syncing of that list. Microsoft has most likely changed the functionality since that article, but I assume it might be something like that preventing you from finding the “stop syncing” option.

Alexander

Just to double check this, I created a new blank list in SharePoint with just a Title field. No "Stop Sync" MSListSettingsExampleBlankList

Marker4 avatar Sep 05 '24 20:09 Marker4

@gerkevgarderen there is another issue reported in a different thread where certain deprecated API's are not currently supported in the new UI, so you might be seeing that.

@reedpamsft Thanks for the reply! The deprecated APIs is about #9898 for example right? We have deployed fixes for the deprecated API, which works well in development. However, this only helps if the extension is being loaded. The issue now is that in many cases it doesn't load the CommandSet extensions at all, while other types of extensions deployed in the same package function fine. Sometimes it works after Ctrl + F5, but even that works half of the time at best.

This might be due to syncing, but as mentioned above, we do not have the option to Stop Syncing for our affected lists. Possibly related to what @SPJS found (thanks for that!):

@Marker4 @keraaj1980 @gerkevgarderen I found an older article (from 2022 - link) mentioning that different “complex” field types like lookups or managed metadata will stop syncing of that list. Microsoft has most likely changed the functionality since that article, but I assume it might be something like that preventing you from finding the “stop syncing” option.

Alexander

gerkevgarderen avatar Sep 05 '24 20:09 gerkevgarderen

Not sure if they rolled back the update? The list view has reverted back to the old look and the command set buttons have started appearing now.

keraaj1980 avatar Sep 05 '24 20:09 keraaj1980

Not sure if they rolled back the update? The list view has reverted back to the old look and the command set buttons have started appearing now.

I just did a hard refresh/clear cache and I am seeing the same thing in both lists with an issue. The old UI is back with the Views as a dropdown instead of tabs. The Command Set buttons are also back.

Marker4 avatar Sep 05 '24 21:09 Marker4

@gerkevgarderen @keraaj1980 @Marker4 yes, we rolled back the new UI based on the two issues being experienced (no command customizers when a list is syncing, and lack of support for the deprecated onListViewUpdated event).

reedpamsft avatar Sep 05 '24 23:09 reedpamsft

@reedpamsft: is there any release-note on the deprecation of onListViewUpdated? What I noticed is, that in commandbar-extensions the IListViewCommandSetExecuteEventParameters has a property selectedRows which was undefined in the new modern UI experience. In issue 9514 there was a proposed workaround - is this the official recommended future solution to use this.context.listView.selectedRows instead of event.selectedRows?

This property also exists in IListViewCommandSetListViewUpdatedParameters which is the parameter for the forementioned onListViewUpdated method - is here also this.context.listView.selectedRows proposed solution?

henningeiben avatar Sep 06 '24 08:09 henningeiben

@reedpamsft and @henningeiben - just to follow up on this also from my side.

I don't think the deprecated code (onListViewUpdated) was never communicated externally, which seems to now cause challenges worldwide, given the millions of users for these extensions. Let's align on this internally @reedpamsft - so that we can work on the plan here. Typically any deprecation which would cause customer and partner code to break - have been communicated clearly with minimum 12 months heads up. This is required to avoid any breaking changes for deployed extensibility worldwide.

We'll work on a clear messaging this internally at Microsoft - Let's continue internal alignment on this @reedpamsft using internal channels and update the ecosystem as we have clear plan going forward. Thanks for jumping in here 👏

for the specific issues - the new UI changes have been rolled back as mentioned in the discussion.

VesaJuvonen avatar Sep 06 '24 09:09 VesaJuvonen

@VesaJuvonen : I don't want to be a nitpicker, but the update did not only affected the onListViewUpdated method of SPFx extensions, but also the onExecute methode, which receives a parameter of type IListViewCommandSetExecuteEventParameters. This type has a property named selectedRows, which was undefined in the new modern UI ... either this was not intended or this needs to be migrated as well.

Can you confirm this?

henningeiben avatar Sep 06 '24 10:09 henningeiben

@henningeiben - no worries on the keeping us honest and you are 100% correct. All of those would be breaking changes for the public codebase. We will revisit this change and messaging internally in Microsoft. Right now the change has been reverted and you should be back to the normal situation which has worked for years. We will work alignment internally.

VesaJuvonen avatar Sep 06 '24 11:09 VesaJuvonen

What I experience today is: List are in old layout if our App is on the site and they are in new layout if I delete the app. This is according to what I found at: https://app.cloudscout.one/evergreen-item/mc600726/

Users in affected tenants will see Lists feature updates as described in this blog post. These improvements will reach all Lists, except those that have been configured with the following features: SharePoint Framework extensions PowerApps forms Approvals The Playlist template Lists that are using these features will not receive the new user experience with this feature rollout. Future rollouts will bring support for Lists that are using these features.

buettiB avatar Sep 06 '24 13:09 buettiB

@reedpamsft to add to your list of things that did not work in the new UI, I noticed that after implementing the workaround, the commands showed up only in the command bar and not in the context menu, as pointed out in here: https://github.com/SharePoint/sp-dev-docs/issues/9905

And thanks for reverting back to the old UI!

svkcode avatar Sep 06 '24 14:09 svkcode

@svkcode thanks! That is on the list.

reedpamsft avatar Sep 06 '24 14:09 reedpamsft

@buettiB right. We had been rolling out the new UI for lists with command customizers, but given the scope of the issues reported here we suspended that rollout. Since the issue was only with command customizers, lists without command customizers should continue to see the new UI.

reedpamsft avatar Sep 06 '24 14:09 reedpamsft

I'm still experiencing this issue even after the rollback. Have to press ctrl+F5 each time I want to see the list customizer. Some users report ctrl+F5 doesn't help anymore.

AKCprcrn avatar Sep 10 '24 10:09 AKCprcrn

@AKCprcrn are you seeing the new UI (with views in tabs across the top) or the old one (with the views as a dropdown)?

reedpamsft avatar Sep 10 '24 17:09 reedpamsft