-
Notifications
You must be signed in to change notification settings - Fork 993
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
dataVersion defined in manifest is not respected when adding a WebPart in a page #8199
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Thank you @mgrosperrin for reporting this one. I can repro this issue and we'll be working on the fix. One remark: |
Hi @AJIXuMuK, Regarding the I will open another issue for that 😄 : #8204 |
@mgrosperrin - the problem is in docs, not in the manifest's schema |
@AJIXuMuK I don't really understand your answer. |
To clarify my lack of understanding, I refer to this issue #1522. Thanks for your clarification on this 😄 |
@mgrosperrin - there are multiple issues related to this topic. But it works incorrectly for sure for the adding web part scenario. And we're working on the fix. |
Hi @AJIXuMuK , do you have any news to share about this issue and the fix you are working on? |
Hi @mgrosperrin - sure! |
@AJIXuMuK Happy to hear that! |
@mgrosperrin - if you add a new web part to the page, you will have |
@AJIXuMuK thanks for the information. |
@mgrosperrin - no. As mentioned in the latest comment, after the fix on |
@AJIXuMuK Not sure to understand: in the previous comment, you said that |
@mgrosperrin - if you update |
@AJIXuMuK yes I want them, but we are an ISV that sell our WebParts and some of our clients want to update the manifest themself. |
What do you mean "update their own manifest"? I don't quite get what scenarios are not covered not this approach. |
The scenario not covered is the time between the update of the code of the WebPart (that we deploy on a CDN) and the time our clients update the sppkg file we send to them. During this interval, WebPart added to the page will have the "old properties" with no way to know they are old (because the To my point of view, this is the reason of the |
@mgrosperrin - I see your point. |
Reopening it for internal tracking until the code is rolled out. |
@AJIXuMuK not sure to follow you. You recommand me to use the version of the manifest? So I will have logic that will check two unrelated versions to determine the version of the schema of the data I am currently deserializing? It is really error prone and in our cases we use the manifest's version to version... the manifest (basically to know which version of the WebPart is used (title, category, etc...) Can you explain why the |
@mgrosperrin - as mentioned in the issue you have posted above #1522 But your point and scenario is valid. |
@AJIXuMuK As the propery was mentioned in the documentation of the manifest (see #8214 that remove it after one of my recent issue), I (wrongly) guess it was removed for some reasons 😄 I agree with your proposal to add a version specific to the data in the manifest instead of maintaining a mapping between version of the manifest and the version of the data 'especially as we compute the manifest's version during the build step 😉 ). |
This should be rolled out WW by now |
Hello @AJIXuMuK, |
@mgrosperrin - yes, please create a new one |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
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
Additional environment details
Describe the bug / error
I have created a WebPart and I need to change the model of the data associated with it.
Following the documentation, I bump dataVersion to
2.0
in the manisfest (preconfiguredEntries.dataVersion
) and in the property of the WebPart, and implement the methodonAfterDeserialize
to handle the migration of the data from the old model to the new one. I add a check to only perform this migration if the version of the data being deserialized is 1.0.When I run this code "locally" (with
gulp serve
), everything is working as expected: theonAfterDeserialize
have a data version of2.0
when I add the WebPart to a page.But when I deploy the package containing the WebPart to the app catalog, the method
onAfterDeserialize
receives the value1.0
for the parameterdataVersion
.Steps to reproduce
preconfiguredEntries.dataVersion
to2.0
dataVersion
of the methodonAfterDeserialize
dataVersion
property to return2.0
1.0
2.0
(as expected)Expected behavior
In the step 6, the newly added WebPart should display
2.0
.The text was updated successfully, but these errors were encountered: