The current UI to see errors or warnings directly related to backups is so lacking.
When coming from a notification, you have to click on “Show”, then click the item of the last operation to open the entire log and manually search for the Errors and Warnings fields.
Right now, the BasicResults
object is serialized in a custom way and stored in the local backup database, at the Message
column in the LogData
table.
Logged events, intended to be used when
constructing an error report or when
debugging
*/
CREATE TABLE "LogData" (
"ID" INTEGER PRIMARY KEY,
"OperationID" INTEGER NOT NULL,
"Timestamp" INTEGER NOT NULL,
"Type" TEXT NOT NULL,
"Message" TEXT NOT NULL,
"Exception" TEXT NULL
);
When retrieving the serialized object, the current approach is to simply dump everything as a string and show it to the user. This leads to a pretty bad user experience, as it is not simple to deserialize this string and therefore you can’t easily differentiate any fields by simply reading the string, among other things.
When serializing, there’s also a collectionlimit
parameter that indicates how many member of a enumerable are serialized and stored, as the amount can be quite big on larger backups.
A good approach that will not require a large amount of refactoring (and db changes) is to serialize as JSON and store it this way. Therefore when retrieving these logs, we can parse it on the front-end (if there is no filtering on the back-end to limit used bandwidth, parsing it is useless) and display it formatted.
Current changes that are needed:
- In a notification indicating errors or warnings, “Show” should redirect the user directly to the Errors/Warnings fields of that specific run.
- Format the data to make it user friendly.
Possible problems:
- The LogData table could grow big on larger backups, we can either limit the number of items per enumerable (the current approach) or clean older logs periodically, or both.
These lists can and should be extended, suggestions are welcome!