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

Locally created entities removed from the server should eventually be removed locally #6231

Open
2 tasks
Tracked by #5991
seadowg opened this issue Jun 26, 2024 · 1 comment
Open
2 tasks
Tracked by #5991
Labels
Milestone

Comments

@seadowg
Copy link
Member

seadowg commented Jun 26, 2024

Blocked by Open Rosa spec

Currently, entities that are deleted on the server, but that Collect has never seen in a server entity list will exist locally forever.

Acceptance

  • Given I've created an entity locally
    And submitted the form that created it
    When the entity is deleted on the server
    And the entity list is then updated
    Then the entity does not still appear in follow-up forms
    And the entity doses not still appear in "View local entities"

  • Collect should limit the number of UUIDs included when constructing the request to integrityUrl so that the request is 2000 characters or fewer (to avoid problems with URL length limits)

Notes

Collect will need a new endpoint in OpenRosa for this to work - Collect needs to ask the server if a local entity that does not appear in the entity list has been removed on the server or not. The current thinking is for that to be provided in the mediaFile for the entity list as integrityUrl like this:

<mediaFile type=”entityList”>
  <filename>people.csv</filename>
  <hash>md5:9fd39ac868eccdc0c134b3b7a6a25eb7</hash>
  <downloadUrl>http://other.appspot.com/blobSource?foo=222</downloadUrl>
  <integrityUrl>http://central.example.com/integrity</integrityUrl>
</mediaFile>

Collect would be able to make a request to this URL and pass entity IDs (like http://central.example.com/integrity?id=id1,id2) and that would respond with:

<?xml version='1.0' encoding='UTF-8' ?>
<entities>
  <entity>
    <id>id1</id>
    <deleted>true</deleted>
  </entity>
  <entity>
    <id>id2</id>
    <deleted>false</deleted>
  </entity>
</entities>

This URL end point isn't implemented yet, but because we'd only ever make the request if integrityUrl was present we can implement this as-is before the Central is finished.

@seadowg seadowg mentioned this issue Jun 26, 2024
24 tasks
@seadowg seadowg changed the title Entities need to be manually deleted after being removed on the server Locally created/updated entities removed from the server should eventually be removed locally Jun 26, 2024
@seadowg seadowg changed the title Locally created/updated entities removed from the server should eventually be removed locally Locally created entities removed from the server should eventually be removed locally Jun 26, 2024
@seadowg seadowg added this to the v2024.3 milestone Jun 26, 2024
@seadowg
Copy link
Member Author

seadowg commented Sep 3, 2024

@lognaturel I'm moving this to v2024.4 for the moment as we've discussed that it should be ok to release it later.

@seadowg seadowg modified the milestones: v2024.3, v2024.4 Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ready
Development

No branches or pull requests

1 participant