pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
749 stars 305 forks source link

Saving metadata via code in PnPJs doesn't work when page is being edited #3098

Closed PieterVandendriessche closed 1 month ago

PieterVandendriessche commented 1 month ago

Major Version

4.x

Minor Version Number

4.3.0

Target environment

SharePoint Framework

Additional environment details

I am using SPFx and pnpJS to edit properties of a page, this in a pane. The page is in edit mode.

Expected or Desired Behavior

Saving the page metadata should work as expected. This behaviour worked before, but doesn't work anymore.

Observed Behavior

image Getting a message that the resource is locked and being edited by the user. Tenant is in targeted release, co-authoring of SP pages might affect this

Steps to Reproduce

`import { spfi } from "@pnp/sp"; import "@pnp/sp/webs"; import "@pnp/sp/lists"; import "@pnp/sp/items";

const sp = spfi(...);

const list = sp.web.lists.getByTitle("MyList");

const i = await list.items.getById(1).update({ Title: "My New Title", Description: "Here is a new description" });

console.log(i);`

Run the code on the page while in edit mode. Assert you will get a 423 (locked)

patrick-rodgers commented 1 month ago

This is likely not something we can control. That would be an error from the server. Will try and have a look at some point on what might be happening.

bcameron1231 commented 1 month ago

Hi. Yea this appears to be a change on the Microsoft side. I have tested on a tenant with standard release, and I don't get this error. It seems like maybe the new co-authoring experience is locking the Site Pages.

I am going to close this for now as it appears unrelated to the library. I would check with Microsoft and see if this is intended behavior.

github-actions[bot] commented 1 month ago

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.