google / ground-android

Ground mobile data collection app for Android
http://groundplatform.org
Apache License 2.0
243 stars 114 forks source link

Non-unique IDs for tasks in different jobs cause tasks to be overwritten in local DB #2484

Open gino-m opened 3 months ago

gino-m commented 3 months ago

This leads to various odd behaviors, like jobs not showing up as "free form" data collection, or jobs having no tasks.

Instead, we should avoid using UUID as PKs in the local db. Instead, we can generate unique numeric IDs, or prevent non-unique IDs in the local DB.

This problem will go away if we serialize the survey as a binary proto in the local db.

scolsen commented 1 month ago

Note from Gino: we should work toward using protos in the local db as well. It would be more valuable to fix this temporarily via destructive changes and to work toward leveraging protos instead.

gino-m commented 1 month ago

I propose the following solution long-term:

gino-m commented 3 weeks ago

@scolsen Using protos everywhere is a much larger project. A patch is low priority here since this is a degenerate case which would only happen if someone accidentally manually adds to jobs with the same IDs. Moving to Icebox.