PacificEMIS / pacific-emis-education-survey-tool

Pacific EMIS Education Survey Tool is the android app used for survey data collection integrated with the Pacific EMIS
GNU General Public License v3.0
1 stars 4 forks source link

School Accreditation surveys duplicate surveys in cloud #21

Closed ghachey closed 2 years ago

ghachey commented 3 years ago

There are still situations that can lead to duplicate surveys somehow. Need to identify how and eliminate this source of problem.

4058709676-how-to-avoid-duplicates-surveys

ghachey commented 3 years ago

Need to see if this is still an issue with the latest version

ghachey commented 2 years ago

This is still an issue in latest

ghachey commented 2 years ago

Here is a whole list of duplicates in production at the moment. It's almost as if the app allows merging both ways ending up in multiple READY (i.e. completed) surveys. DO NOT work on the production files for any troubleshooting. This issue MUST be reproduced in the DEVELOPER cloud service account while leaving the production service account UNTOUCHED.

One thing to test in development is this. An original specification for the app was that a merged partial survey would become no longer usable. For example, a worker tablet merges a partial survey into the team leader tablet. The partial survey on the workers tablet becomes in MERGED state and thus can no longer be used. It should not be possible for the completed survey on the team leader tablet to be merged into the MERGED worker tablet. This is a possible scenario I can think of that could lead to the below. But other scenarios are possible and we need to identify what is causing this.

Screenshot 2022-06-30 114623
ghachey commented 2 years ago

From Omega-R:

In the meantime, please clarify the following scenario: we have a Survey with the status Completed (1 device), and we want to merge this survey to another device (2 device), once it's merged the Survey on device 1 gets status Merged, the merged survey on device 2 gets status Completed, is that correct so far? So we assume that the survey from device 2 can not be merged back to device 1, correct?

ghachey commented 2 years ago

No, that is not the original specifications.

Once you have a Completed survey there is no need to merge into another one. It is already completed and is usually done into the team leader's tablet (device 1). We have a completed survey (in device 1) and that will be the official one that will be processed into the system. All the workers' tablets (device 2, 3, 4, etc.) merge into the team leader's tablet (device 1). It is a one way only thing. When they (the workers tablet or device 2, 3, 4) have merged their content they become in status MERGED (from a previous in progress status). And it should not be possible to merge something else into this worker tablet (merging back the completed device 1 into device 2 in merged state should be refused with the following message.

"This tablet was already used as a worker tablet and was already merged into the team leader's tablet. You do not need and can not merge anything back here. You can merge again into the team leader's tablet if you really need to, but any final adjustments can simply be done in the team leader's tablet."

The MERGED status is final. The only thing that would be acceptable (though it would not be that important) would be that the same worker could re-merge into the team leader again (for example if they worker updated something and would want to push updates to team leader tablet. But this scenario is not too important as any final chance could be done simply on the team leader's tablet.)

Here the tablet app is already behaving almost perfectly. Please any improvement is welcome (and desired) but MUST be done with care as I do not want to introduce any issue. So please make sure everything is perfectly clear before any chance. And must be tested into its own branch thoroughly.

On the duplicates it just happens and you will have to try out many things until you can reproduce it in development. When I will have a bit more time I will also try on my end and see if I can get more information from the team on the ground doing this in production.

Hope this helps

ghachey commented 2 years ago

This does not work as described above. We need to discuss this in a brief call. For example, I do not think I requested the following scenario.

When trying to merge a completed survey into a newly created or in progress survey to get the following.

Screenshot 2022-09-15 132259

We need to be able to merge a completed survey into another new file as this sometime we use to fix an issue where we do not see the survey in the cloud even it is says sync'ed on the tablet.

[UPDATES]

After discussing with @maratomega it was decided that a better strategy for handling cases where a cloudfile is not in the cloud (maybe because of transient Internet issue) would be to add a feature where a user could tap on the cloud icon to do a verification and if needed a re-sync of the file. This is a cleaner, faster approach then re-cloning files using the merge feature.

ghachey commented 2 years ago

As explained above, the MERGED status is final. The only thing that is acceptable is a re-merge. But in the current build, I have a worker for which the file below has already been merged into another tablet (it has sent its partial survey to the team leader's tablet) as shown below.

Screenshot 2022-09-15 134612

However, I am able to start the merge from another tablet into this already merged survey. This is a source of problems and confusion and should NOT be allowed.

Screenshot 2022-09-15 134751

When a survey has already been merged (hence in MERGED state) should not be able to merge from another tablet. Clicking on Merge as shown above should return the following message.

"This survey has already been merged into the team leader's tablet. While you can merge again into the team leader's tablet (or even another tablet) you are not allowed to merge from another tablet into this survey."

maratomega commented 2 years ago

https://user-images.githubusercontent.com/108275362/191010521-ef1cd737-af1f-4715-a8a6-f734ce86276f.mp4

Hi @ghachey Here is the discussed feature where a user could tap on the cloud icon to do a verification and if needed a re-sync of the file. Kindly let me know if we need to add something else (like additional pop-ups) or we are good here.

ghachey commented 2 years ago

@maratomega this is good.

ghachey commented 2 years ago

Needs more testing. I still see some odd duplicates in progress status which I am currently unsure where they came from. More details coming soon.

ghachey commented 2 years ago

I have not been able to reproduce the duplicate files in the cloud yet. I will close this as resolved. If we encounter again we can create another more specific issue with reproducible results.