Skip to content
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

ContentEdition : The diff should handle "\n" and "\r\n" seemlessly #495

Open
mdeslauriers-sigmund opened this issue May 3, 2023 · 2 comments
Assignees
Labels
13.x NETCORE v13 - next LTS changes.

Comments

@mdeslauriers-sigmund
Copy link

mdeslauriers-sigmund commented May 3, 2023

Describe the bug
The comparison between contents in the database and contents in the xml files doesn't handle line-break correctly between Windows and Linux. NewLine is always marked as different by the report tool, and importing again doesn't fix anything.

To Reproduce
Steps to reproduce the behavior:

  1. On Windows, in a local dev environment
  2. Create a content using a DocumentType with block-list, property
  3. Take a look at the xml file generated on the disk for this content : the property is a JSON string where the line breaks treated as "\r\n"
  4. Deploy the code on an Linux Azure App Service
  5. Go to the Azure Webapp
  6. In the uSync backoffice, Click "Report"
  7. See the content needs to be imported.
  8. Import the content by clicking "Import" (or full import)
  9. Make sure the content has been imported in the content tree
  10. Go back to the uSync backoffice, click "Report" again
  11. See error : The content is still marked as different (needing a sync)
  12. Cilck on the "Detail" link and see that all that differs are the line-breaks (see screenshots)

Expected behavior
The compare tool should not consider \n and \r\n as different.

Screenshots
image

About your Site (please complete the following information):

  • Umbraco Version: 10.5.1
  • uSync Version: 10.5
  • Browser: Chrome, Firefox

Additional context

  • Local dev environment : Windows
  • Cloud hosting environment: Azure WebApp on Linux App Service
@mdeslauriers-sigmund mdeslauriers-sigmund changed the title uSync.ContentEdition : The diff should handle "\n" and "\r\n" seemlessly ContentEdition : The diff should handle "\n" and "\r\n" seemlessly May 3, 2023
@KevinJump
Copy link
Owner

Yeah - we do something for this when its' new lines inside the xml, but not encoded new lines.

It may take a bit of file fangling but I think we can probably do something to make sure they are represented the same way.

@KevinJump KevinJump self-assigned this May 3, 2023
@KevinJump
Copy link
Owner

Little complicated, but we are going to push this into our the System.Text.Json migration (Umbraco are dropping Newtonsoft). so v13 are the earliest for this i think :(

unless someone can find a super quick and reliable way for us to reach into all the JSON serialization in uSync (but not system-wide) and get it consistant?

@KevinJump KevinJump added the 13.x NETCORE v13 - next LTS changes. label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
13.x NETCORE v13 - next LTS changes.
Projects
None yet
Development

No branches or pull requests

2 participants