johnding1996 / HKUST-COMP3111H-Group

Group Project of COMP 3111H in Fall 2017 at HKUST
Apache License 2.0
0 stars 0 forks source link

User Info is failed to update #116

Closed thomaszhouan closed 6 years ago

thomaszhouan commented 6 years ago

According to log message, if user info for a user already exists, the InitialInputRecorder failed to update the row when user says setting

johnding1996 commented 6 years ago

This is due to the fact that you only use the UserQuerier.add() method (which only works when add a new row to database). You should use UserQuerier.update() instead when UserQuerier.add() returns false. This is not a bug, you should pay more attention to the database APIs, which have clear javadocs.

https://github.com/johnding1996/COMP3111H-Group/blob/923752abe1cfa57b232c684b79542c67b7527e1d/dieting-chatbot/src/main/java/misc/InitialInputRecorder.java#L134