Thursday, December 04, 2008

Bad potential Mapguide FDO dataloss bug

I just posted a test case which demonstrates a rather bad poential dataloss bug with $featureService->UpdateFeatures.

FeatureService.UpdateFeatures doesn't log errors and reports them as successful

Basically, if an error occurs, the operation doesn't throw an error and just returns the error message in the result which needs to be manually inspected.

This is bad, none of the code examples do this and usually developers would expect an exception to be thrown. You do not know if your FDO Update was successful UNLESS you check the result as demonstrated in my test case.

Anyone using MapGuide should check this out and decide whether they need to update their code to add checking for such errors.

Personally I think update features should just throw an error and not 'silently' return the error.

The nasty aspect of this bug (besides not throwing) is that no error is logged to the error.log and the access.log reports the operation as being successful, when it has failed.

No comments: