Skip to content

[Rate Soil] Local updates go to server per sync system #3068

@knipec

Description

@knipec

Description

  • This is basically “make it work offline” but also “make it work at all”, since the data flow is the same between online and offline, it’s just about when we push the user-updated data from the client to the server

Acceptance criteria

  • Confirm that soil cards & selected match stay correct:
    • When you make changes to a soil's rating offline
    • When you come back online after rating multiple soils on multiple sites
    • When you make changes online
    • If someone else made soil ratings for your site, you see them on a pull
    • If you AND someone else made soil ratings for your site, last push wins
  • Confirm that soil data changes still work online & offline, in conjunction with rating changes
  • Confirm that error behavior works as specified in Carissa's doc -- alas, I only know how to reliably access some of these scenarios by modifying backend code to raise errors
  • Note: QA testing this will require the staging backend to have been updated with fix: [rate soil match] rename to UserDataPush + update types + deprecate old mutation terraso-backend#1909

With the FF_select_soil feature flag on, the mobile client should be able to call the new pushSiteData mutation, which should update the backend to include userRatings in soilMetadata. Previously soilMetadata could not be edited offline, but this should enable it to be edited offline (which the client code should already allow; I recently implemented this) and pushed to the backend when the client returns online.
Similar to how pushing soil data worked, the push should happen when the client returns from offline to online, or when the client is online and the user makes edits to the userRatings.

Dev notes

  • Check in with Johannes as we implement
  • Write tests

Metadata

Metadata

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions