Greenstand / Greenstand-Overview

Tree Tracking Fighting Poverty and Climate Change - This repository contains Contributing, Project Overview, Roadmap, etc
https://www.greenstand.org
GNU Affero General Public License v3.0
44 stars 11 forks source link

Send and Match Sequence ID #60

Closed Davidezrajay closed 4 years ago

Davidezrajay commented 5 years ago

This is to prevent the phone from sending multiple sequences. May already been done in the app, could just be an API + server-side issue

ZavenArra commented 5 years ago

Need to work across app re-install.

General idea: if sequence is not greater than greatest sequence from this device, skip insert and return 201.

But, on reinstall sequence 1 will reappear.

Modification: If sequence is not greater than the MOST RECENT sequence from this device, skip insert and return 201.

But, still doesn't allow us to go back to zero.

Modification: If sequence is not greater than the MOST RECENT sequence from this device, skip insert and return 201 unless the sequence is 1 and the coordinates of the most recent sequence 1 do not match the current record.

ZavenArra commented 5 years ago

We might also want to write every upload out to a log file, so that issues like this can be tracked.

ZavenArra commented 5 years ago

our devices table also tracks just the android_id, which is phone specific, and not an app installation specific Id. This means that users running both our default flavor and the JustDigIt flavor (such as testers) will run into problems with sequence numbers. should we create separate entries in devices for different flavors. Devices also needs created_at, updated_at fields.