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

fix: handle emojis errors in delta jobs #185

Merged
merged 2 commits into from
Sep 3, 2024
Merged

Conversation

sbellone
Copy link
Collaborator

@sbellone sbellone commented Aug 30, 2024

When some product attribute contain an emoji (e.g. 🐣), SFCC Delta export fails to generate a valid XML: the XML contains those characters: ��

To solve this problem, the "Filter Invalid XML Characters during Export" feature must be enabled in Administration > Global Preferences > Import & Export. When enabled, the emojis are correctly exported. (I found that thanks to this Medium post)

This PR makes to following improvements to the Delta export job:

  • Report the actual error in the Business Manager. Previously we were only reporting a generic "Error reading from file..." message
    • The message also let users know about the "Filter Invalid XML Characters during Export" feature
  • Move the problematic delta export files to a _failed directory. This permit to not block subsequent jobs. Currently, the file needs to be deleted manually

How to test

  • Insert an emoji in a product description
  • Run the delta export job
  • The error should be properly reported in the logs and in the Business Manager
  • The delta export files should be moved to /IMPEX/src/platform/outbox/algolia/productDeltaExport/_failed/

image

  • Then enable the "Filter Invalid XML Characters during Export" feature
  • Insert another emoji in a product description
  • Run the delta export job, which should complete successfully

SFCC-366

@sbellone sbellone self-assigned this Aug 30, 2024
@sbellone sbellone requested a review from htuzel September 2, 2024 08:14
@htuzel
Copy link
Collaborator

htuzel commented Sep 3, 2024

Woow, I wasn't aware of this feature. Clear solution, thank you

@sbellone sbellone merged commit a8e4d12 into master Sep 3, 2024
2 checks passed
@sbellone sbellone deleted the fix/delta-jobs-emojis branch September 3, 2024 14:46
@sbellone
Copy link
Collaborator Author

sbellone commented Sep 6, 2024

Note: I had forgotten to put back the lock on the master branch and merged into it.
To fix that, I've now rebased the develop branch onto master, to avoid problems during the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants