Skip to content

Introduction of the new _rev field for survey questions in Planet #10033

@PlataformasInformaticas

Description

With the introduction of the new _rev field for survey questions in Planet, myPlanet must properly synchronize this field and validate its consistency before completing any synchronization process.


Goal

Ensure that myPlanet:

  • Synchronizes the _rev field for each survey question.
  • Validates that the _rev value matches the expected version before syncing.
  • Prevents survey synchronization when question changes could lead to data inconsistencies.

Current Problem

  • myPlanet does not currently synchronize or validate the _rev field for survey questions.
  • There is no mechanism to detect whether a question has been modified since the last synchronization.
  • This can result in:
    • Responses being linked to incorrect or outdated question versions.
    • Data inconsistencies between Planet and myPlanet.
    • Potential data integrity issues in the local database.

Proposed Solution

  1. Synchronize the _rev field for each question when surveys are downloaded or updated from Planet.
  2. During the synchronization process:
    • Validate that the _rev value of each question matches the locally stored version.
    • If any mismatch is detected:
      • Block or cancel the synchronization of the survey.
      • Log or notify that version conflicts exist.
  3. Ensure that stored responses are always associated with the same question version (_rev) used when the response was created.

Benefits

  • Preserves data integrity and consistency.
  • Prevents silent errors during synchronization.
  • Improves traceability of survey changes.
  • Enhances stability of the survey system in myPlanet.
  • Reduces the risk of invalid or inconsistent data.

Technical Considerations

  • The _rev field must be stored and validated per question, not only at the survey level.
  • Expected behavior in case of conflicts should be clearly defined:
    • Cancel synchronization.
    • Notify the user.
    • Log the conflict for auditing.
  • Validation should be applied during both initial sync and subsequent updates.

Context

This validation is critical for surveys that have already been answered, as any post-deployment changes to questions can compromise the validity of collected data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions