Skip to content

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

Description

@mdeslauriers-sigmund

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions