serradi / smap-suite

Automatically exported from code.google.com/p/smap-suite
0 stars 0 forks source link

Re-starting a task after its instance is deleted fails silently #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a task & save it
2. Go to 'Manage Forms and Data", select the data tab and delete the instance 
for the newly created task
3. Return to the tasks screen and select the task

When a task does not have an instance then a new instance should be created.  
This is the same as the user selecting "create local task" which results in 
processEnterData() being called.  This would be the situation if a task had 
been downloaded from the task interface.  It would have no instance until it is 
selected.

The code is in MainListActivity().  The problem probably occurs in two places 
because an existing task can be started by simply selecting it in the list or 
doing a long press and selecting "Complete Task" from the context menu.  [Note 
the reason for having "complete task" in the context menu is because the 
context menu was available on the map screen and allowed a user to continue a 
task via the map interface].  However redundent code is not desirable.

A longer term aspect to the solution might be to more intelligently manage the 
old data instance files.  They are a security problem just sitting on the 
phones sdcard.  In the j2me solution the old files are always deleted as soon 
as they have been sucessfully uploaded.  If we take that approach we can remove 
the ability to manually delete old instance files.  They would be removed 
whenever the task is removed either by deleting it or uploading it. We may want 
to take this approach or at least make it an option.  However in the interim we 
absolutely don't want to lose any data so we should hold of on this change and 
monitor what happens during a few more surveys.

Original issue reported on code.google.com by neilpen...@gmail.com on 20 Jul 2011 at 12:50

GoogleCodeExporter commented 9 years ago
I'll handle this one.

Original comment by neilpen...@gmail.com on 11 Jan 2012 at 1:31

GoogleCodeExporter commented 9 years ago
There is a related issue in that instances that are completed but cannot be 
uploaded, perhaps because the survey has been discontinued remain as tasks even 
after they are manually deleted.  The task should be deleted when the instance 
is deleted for this reason even if the instance is deleted after upload.

Making this a high priority as it can confuse surveyors

Original comment by neilpen...@gmail.com on 14 Aug 2012 at 1:39