hotosm / fmtm

Field Mapping Tasking Manager - coordinated field mapping.
https://fmtm.hotosm.org/
GNU Affero General Public License v3.0
44 stars 44 forks source link

Use stub for project creation (idempotent workflow) #1291

Open spwoodcock opened 7 months ago

spwoodcock commented 7 months ago

Is your feature request related to a problem? Please describe.

Task creation may fail due to various reasons not related to incorrect input (server overload, db connection limit, etc).

Describe the solution you'd like

The project files generation should be idempotent.

This means that there are checks to see which tasks have an odk token, form in odk central and uploaded geojson media.

It would increase the time of the endpoint due to additional calls, but worth it to allow multiple sequential executions, i.e. resume.

Describe alternatives you've considered

An additional endpoint to resume, but it would be nice to have the same one.

@manjitapandey

spwoodcock commented 4 months ago

To facilitate this I think we should update the project creation flow.

Current:

Proposal:

Advantages of this approach:

spwoodcock commented 2 months ago

Note: we have ProjectStatus enum with DRAFT=2, so should probably create the stub with DRAFT status.

Once complete, change to PUBLISHED, enum id = 1