OS: Windows
Commit hash: 09eee940cdfc2f46b63bad866fac288430f10cb8
toxcore: toxcore version: 0.2.1
Qt version: 5.10.1
…
Reproducible: Always
Disable all settings that need database features like faux offline message and history. Delete the db files and restart qtox to write something. When you look into the database you will find your chat history.
There should be no databse created at all.
Confirmed. Database is recreated with history disabled and every new message is added to it.
table faux_offline_pending never has any content.
table history has all messages sent by the user, but none from their peer. These messages aren't shown when loading chat.
Introduced in 6780331f4086dff562dda871ae81c1edfe3f757e which was after v1.13.0 meaning only releases v1.14.0 and v1.14.1 are effected.
Seems there should be a condition in https://github.com/qTox/qTox/commit/6780331f4086dff562dda871ae81c1edfe3f757e#diff-39d71983c1fc16a6b3191ee87174baaeR978 to check if history is enabled.
I think it's probably better to still pass in history if it exists, and check the setting on each message save, so that if the "disable history" setting is changed, messages can start/stop being saved without having to restart qTox. This was also the previous behaviour before https://github.com/qTox/qTox/commit/6780331f4086dff562dda871ae81c1edfe3f757e#diff-60595a64f8caa4731410f791ff3e8bbaL790 since isHistoryEnabled checks both history != nullptr and the setting of disabled history. PR created and tested.
Note that despite this ticket's There should be no database created at all., we do (and have for a while) created the db regardless of whether history is disabled, and just not saved messages to it when disabled. I think this is probably better behaviour for the reasons described above, and I don't really see a downside since it doesn't contain any info, but it could be created dynamically on re-enabling of history as an improvement in the future.
When a user disables history, should their history be cleared?
When you turn the history setting from enabled to disabled it will tell you that the history will be deleted. That's why I said "There should be no database created at all."
Most helpful comment
I think it's probably better to still pass in
historyif it exists, and check the setting on each message save, so that if the "disable history" setting is changed, messages can start/stop being saved without having to restart qTox. This was also the previous behaviour before https://github.com/qTox/qTox/commit/6780331f4086dff562dda871ae81c1edfe3f757e#diff-60595a64f8caa4731410f791ff3e8bbaL790 sinceisHistoryEnabledchecks both history != nullptr and the setting of disabled history. PR created and tested.Note that despite this ticket's
There should be no database created at all., we do (and have for a while) created the db regardless of whether history is disabled, and just not saved messages to it when disabled. I think this is probably better behaviour for the reasons described above, and I don't really see a downside since it doesn't contain any info, but it could be created dynamically on re-enabling of history as an improvement in the future.