Message about unsaved data after refreshing the page without any changes when the element has the component type

I have…

  • Read the following guideline: Troubleshooting and Support | Squidex. I understand that my support request might get deleted if I do not follow the guideline.
  • Used code blocks with ``` to format my code examples like JSON or logs properly.

I’m submitting a…

  • Regression (a behavior that stopped working in a new release)
  • Bug report
  • Performance issue
  • Documentation issue or request

Current behavior

I created content, such as a question, which includes a component type like ComplexAnswer. When I saved this component and revisited it without making any changes, and then refreshed the page, I received an alert message:
obraz

This behavior is incorrect because I did not make any changes. This issue only occurs if the element has an empty component type (components work fine). When I use the Add component button and save, the redundant alerts disappear.

Upon reviewing the code, I discovered the problem lies with dataAutosaved. In the method this.contentForm.hasChanges(dataAutosaved), changes are shown as Object { } in console.log, whereas the initial data is Object { iv: undefined }. These two fields are not equal, but they should be.

Expected behavior

Without any change in content, you should not receive a save notification. Especially since this only happens when the element has the type component.

Minimal reproduction of the problem

1.Create component anserw
2. Create multiple contents: question-container
3. Add field ComplexAnserw in question-container which is type Component (in valditaion slelect anserw shcema). Also create simple String field Question.
4. Create content for this question. Fill text field and stay empty component fiedl. Don’t click Add button.
5. Save component and exit from this content
6. Go back to created component
7. Refresh page
8. You shoud have redundant alert.

Environment

App Name:

  • Self hosted with docker
  • Self hosted with IIS
  • Self hosted with other version
  • Cloud version

Version: [VERSION]

Browser:

  • Chrome (desktop)
  • Chrome (Android)
  • Chrome (iOS)
  • Firefox
  • Safari (desktop)
  • Safari (iOS)
  • IE
  • Edge

Others:

Interesting. Should be an easy fix when you just not set properties to undefined for the initial value.