PhenoApps / Field-Book

https://fieldbook.phenoapps.org
GNU General Public License v2.0
51 stars 54 forks source link

[BUG]: Non-initial exports to Breedbase may display error message, and after error message data may or may not be uploaded #917

Open noahddewitt opened 7 months ago

noahddewitt commented 7 months ago

Description

We are dealing with the situation where we have a large number of trials imported from a Breedbase instance across multiple android devices, and data export has been challenging. Trait and trial import from Breedbase is successful, and the initial export of values for an imported trait is successful. Subsequent attempts may or may not trigger an error message. A few modes we've observed:

  1. Starting a trial one day and finishing the first 2/3 or the trial, then exporting to Breedbase is successful, with no error message and values observed in Breedbase. Finishing phenotyping the trial the next day and submitting the additional observations is successful (though it is not totally clear if the observations are being overwritten, or if only the new phenotypes are added).

  2. Two students collect data on one block each of a replicated test. The first student submits their values from phone 1 and succeeds in exporting the data, with the data appearing in Breedbase. The second student submits their values from phone 2, and triggers an error message "BrAPI export failed". However, in looking at Breedbase the second student's values were in fact submitted successfully.

  3. Data is collected on a trial for phenotype 1. Some modifications are made to that data directly on Breedbase. Data is collected the next day for the same trial for phenotype 2 (also imported from breedbase). On export, the error message "BrAPI export failed" is displayed, and the values do not appear in Breedbase. After the first failed export, the number under "NNNN New Observations" is now twice the number recorded, and this number persists (similar to behavior in open issue #880).

This issue may be resolved to a failure to sync observations (as open in #880 ), as we are still unable to sync observations across phones, and sync changes to the trial on Breedbase to phones. Please let me know if there is additional info we can provide!

Expected behavior

No response

Field Book version

No response

noahddewitt commented 7 months ago

Another example from this morning that may be helpful. An incorrect value for the trait (zero) was corrected to a different value (eight) for an 80-plot RCBD test. On attempting to export this to breedbase, the following page was displayed:

Screenshot_20240314-084308

My explanation for those numbers is that there are two total traits collected (160 observations), I changed one observation for one of the trait, making it 159 synced observations and 1 new observation. However, only one of the two phenotypes was selected for export. Another odd thing is the "2 user created tests" -- I have a "Notes" text trait I created instead of importing for BrAPI, and I have to values for it, but they are in a separate trial.

Upon hitting "Export", it prompts me to authorize Fieldbook to export to our Breedbase instance, which opens in-app and authorizes successfully. Unfortunately, instead of syncing we get the message "Error: Response number of observations different from request". Checking Breedbase, the phenotypic observation changed in Fieldbook did not change in Breedbase.