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

Duplicate EAS records created during sync for organisation that uses both approvals and media in encounter #678

Closed
petmongrels opened this issue Jan 5, 2024 · 5 comments
Assignees

Comments

@petmongrels
Copy link
Contributor

Reproduce

  • akrsp. staging.
  • perform scheduled encounters that have approval enabled and has media fields (jan chaupal e.g.)
  • sync
  • see duplicate EASes created on server for the same encounter in pending status
@petmongrels petmongrels self-assigned this Jan 5, 2024
@petmongrels petmongrels converted this from a draft issue Jan 5, 2024
petmongrels added a commit that referenced this issue Jan 5, 2024
…ual_id is same as entity_id for Subject entity type.
@petmongrels
Copy link
Contributor Author

What to test

  • Approval flows (check whether these are getting sycned to server as well)
  • Forms with media attached
  • Form with both media and approval

@petmongrels petmongrels moved this from In Progress to Code Review Ready in Avni Product Jan 5, 2024
petmongrels added a commit to avniproject/avni-client that referenced this issue Jan 5, 2024
petmongrels added a commit that referenced this issue Jan 6, 2024
@vinayvenu vinayvenu moved this from Code Review Ready to In Code Review in Avni Product Jan 9, 2024
@vinayvenu
Copy link
Member

The server change looks non-backwards compatible. Won't this prevent sync for those who are on an older apk?

@vinayvenu vinayvenu moved this from In Code Review to Code Review with Comments in Avni Product Jan 9, 2024
@petmongrels petmongrels moved this from Code Review with Comments to Code Review Ready in Avni Product Jan 9, 2024
@vinayvenu
Copy link
Member

If there are older implementations, there will be duplicates in the client that won't be available in the server. Need to test that this doesn't cause any issues on the client. In any case, we are still going ahead with this change.

@vinayvenu vinayvenu moved this from Code Review Ready to QA Ready in Avni Product Jan 9, 2024
@Dinesh2019 Dinesh2019 moved this from QA Ready to In QA in Avni Product Jan 9, 2024
@Dinesh2019
Copy link

Still we get the duplicate entries attached the video for the references

af8b9ecc-bd6e-4122-bad0-85f8e50e61d7.mp4

@Dinesh2019 Dinesh2019 moved this from In QA to QA Failed in Avni Product Jan 9, 2024
@petmongrels petmongrels moved this from QA Failed to In Progress in Avni Product Jan 10, 2024
@petmongrels
Copy link
Contributor Author

The query used is incorrect because it is not checking whether the status is approved or pending. The two entries in are in two different status - which is allowed. We do not overwrite the previous entry.
The fix in this card was to not allow Pending on top of another Pending. Approved after pending is valid.

@petmongrels petmongrels moved this from In Progress to QA Ready in Avni Product Jan 10, 2024
@Dinesh2019 Dinesh2019 moved this from QA Ready to In QA in Avni Product Jan 10, 2024
@Dinesh2019 Dinesh2019 moved this from In QA to Done in Avni Product Jan 10, 2024
petmongrels added a commit to avniproject/avni-client that referenced this issue Jan 11, 2024
1t5j0y added a commit to avniproject/avni-etl that referenced this issue Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants