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

Fhir engine converts List resource to Binary resource while syncing #2466

Open
mansikalraa opened this issue Mar 8, 2024 · 2 comments
Open
Labels
P1 High priority issue

Comments

@mansikalraa
Copy link

mansikalraa commented Mar 8, 2024

Describe the bug
A clear and concise description of what the bug is.

@jingtang10 @aditya-07
Fhir engine converts List resource to Binary resource while syncing. The change log in LocalChangeEntity is correct, But while uploading the resourceType is converted to binary and the data is something entirely different.

  {
      "fullUrl": "List/569",
      "resource": {
        "resourceType": "Binary",
        "contentType": "application/json-patch+json",
        "data": "W3sib3AiOiJyZXBsYWNlIiwicGF0aCI6IlwvZGF0ZSIsInZhbHVlIjoiMjAyNC0wMy0wOFQwNTowNzozMy40NDVaIn0seyJvcCI6InJlcGxhY2UiLCJwYXRoIjoiXC9lbnRyeVwvMlwvZGF0ZSIsInZhbHVlIjoiMjAyNC0wMy0wOFQwNTowNjo0OSswMDowMCJ9LHsib3AiOiJhZGQiLCJwYXRoIjoiXC9lbnRyeVwvMlwvaXRlbVwvcmVmZXJlbmNlIiwidmFsdWUiOiJRdWVzdGlvbm5haXJlUmVzcG9uc2VcL2ZhNjUzYmNmLTkxMjctNDg1Mi1iZTc5LTU2M2E2N2NlODllMSJ9LHsib3AiOiJhZGQiLCJwYXRoIjoiXC9lbnRyeVwvMlwvaXRlbVwvdHlwZSIsInZhbHVlIjoiUXVlc3Rpb25uYWlyZVJlc3BvbnNlIn0seyJvcCI6InJlcGxhY2UiLCJwYXRoIjoiXC9lbnRyeVwvMlwvZmxhZ1wvY29kaW5nXC8wXC9jb2RlIiwidmFsdWUiOiIwMyJ9LHsib3AiOiJyZXBsYWNlIiwicGF0aCI6IlwvZW50cnlcLzJcL2ZsYWdcL2NvZGluZ1wvMFwvZGlzcGxheSIsInZhbHVlIjoiY29tcGxldGVkIn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CJ9XQ=="
      },
      "request": {
        "method": "PATCH",
        "url": "List/569",
        "ifMatch": "W/\"2\""
      }
    }

Due to this the syncing process fails entirely, which is causing us the loss of important data.

Component
Core library (Fhir engine)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

The resourceType of List resource should not be changed to Binary, and the syncing process should work correctly.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: [e.g. Pixel4a emulator] OPPO A15s
  • Android version: [e.g. Settings -> About phone -> Android version] 10
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Would you like to work on the issue?
Please state if this issue should be assigned to you or who you think could help to solve this issue.

@santosh-pingle
Copy link
Collaborator

does it work for other resource type e.g Bundle, Single Resource Patch?

@santosh-pingle santosh-pingle added the P1 High priority issue label Mar 11, 2024
@aditya-07
Copy link
Collaborator

@mansikalraa Can you provide the data (maybe the LocalChangeEntity of List/569) for us to debug the issue that the Binary data is completely different ?

The PATCH's data is basically Base64 encoding of the LocalChangeEntity.payload and incase List/569 has more than one LocalChangeEntity (multiple changes made to the list resource on device before sync), then all of these LocalChangeEntity are merged (as per Json Patch Merge) to create a single LocalChangeEntity.payload and sent up in a PATCH to the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue
Projects
Status: New
Development

No branches or pull requests

3 participants