carboncoop / home-energy-health-check

A simple energy assessment framework to assess a home's key energy efficiency issues.
2 stars 2 forks source link

'This assessment has already been submitted.' message #19

Closed lowwintersun closed 7 years ago

lowwintersun commented 7 years ago

A new assessment is created. Changes are made eg measures are recommended. Clicking to the 'Done' tab, a message appears: 'This assessment has already been submitted.'

Some users report that this message leads to loss of data.

assessment submitted

AppSynergy commented 7 years ago

DNR as far as I can see - the message will only appear if you have actually submitted the assessment (and I think loss of data should be a different issue, as I'm pretty sure it's unrelated).

The correct repro for the above:

Which is the intended business logic, unless I've missed something?


For clarity, here's what the three buttons do:

Save Locally

Save and Quit

Submit

lowwintersun commented 7 years ago

OK, I've so far replicated it in Firefox and Chrome on the laptop using both 'admin' and 'assessor' user accounts and after flushing the cache.

The steps you outline above are correct, in terms of how it should work. What I'm getting is:

...as you say, this may well be unrelated to any data loss.

AppSynergy commented 7 years ago

You're right - got it now though! The important clue is that this only happened on the seem- domain, not any other environments.

It was a database driver issue - it wasn't using the right PDO mysql native driver and integer values were coming out as strings ("0" wasn't falsey, so the app thought you had set the submitted flag when you hadn't).

I've set the right driver now.

I don't think there's any reason to suspect this config caused any data loss, as the values are all still correct in the database itself.

By the same logic, the "Further visit required - yes/no" field may have flipped itself to Yes in some submissions.

lowwintersun commented 7 years ago

Thanks Adam. I will now investigate this data loss issue further.