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

Inconsistency in user facing taskID and taskid of downloaded geojson task file #2009

Open
manjitapandey opened this issue Dec 20, 2024 · 3 comments
Assignees
Labels
backend Related to backend code bug Something isn't working effort:low Likely a few hours priority:low Backlog of tasks that will be addressed in time

Comments

@manjitapandey
Copy link
Contributor

Describe the bug
Reported by KU field activity, When I downloaded the task boundary from the FMTM website, I got a geojson file.
The downloaded geojson file has one column in the attribute table named tasks_id. But the task id that is provided here doesn’t seem to match the actual task id seen on the user end.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'project details page'
  2. Click on 'download tasks'
  3. upload the geojson file in QGIS and view its taskID
  4. See error

Expected behavior
The taskID should be consistent everywhere.

Screenshots
Image

Additional context
They needed the task id during analyzing the result, but we couldn’t find the way to get that.

@manjitapandey manjitapandey added the bug Something isn't working label Dec 20, 2024
@Sujanadh Sujanadh added backend Related to backend code priority:low Backlog of tasks that will be addressed in time effort:low Likely a few hours labels Dec 20, 2024
@Sujanadh Sujanadh self-assigned this Dec 20, 2024
@Sujanadh
Copy link
Collaborator

So those task_ids are the actual task ids, which are the primary keys of tasks. We use task index project-wise, starting from 1 in our management frontend of fmtm. It is a small fix, using project task_index instead of the actual id of the task.

@spwoodcock
Copy link
Member

spwoodcock commented Dec 20, 2024

A thought

Perhaps at some point we refactor and write migrations to update the task id to actually be the task index everywhere.

Then project id and task id can be a composite key together to ensure uniqueness.

We even have rest endpoints in structure
/project/projectid/task/taskid
so this would make more sense.

A task is only ever referenced in relation to a project.

A second thought 😂

  • Just after writing this I considered electric SQL.
  • Before attempting this we should make certain that a composite primary key would definitely work with electric / PGLite, as I'm not 100% certain.
  • Probably fine, but needs to be checked when we get to this.

@spwoodcock
Copy link
Member

Saying all that, for now we should just use the task index in this endpoint response, as Sujan says 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code bug Something isn't working effort:low Likely a few hours priority:low Backlog of tasks that will be addressed in time
Projects
None yet
Development

No branches or pull requests

3 participants