johannesjo / super-productivity

Super Productivity is an advanced todo list app with integrated Timeboxing and time tracking capabilities. It also comes with integrations for Jira, Gitlab, GitHub and Open Project.
http://super-productivity.com
MIT License
8.67k stars 753 forks source link

TypeError: Cannot convert undefined or null to object #3052

Closed sm8ps closed 3 months ago

sm8ps commented 4 months ago

Steps to Reproduce

I do not know what really has happened. I closed the app regularly yesterday via "Finish my day" and upon reopening it today I was "greeted" with the following error message outlined in red.

TypeError: Cannot convert undefined or null to object
isHandledError (webpack:///src/app/core/error-handler/global-error-handler.class.ts:45:12)FormlyMaterialModule (webpack:///node_modules/@ngx-formly/material/fesm2015/ngx-formly-material.js:16:6)invoke (webpack:///node_modules/zone.js/fesm2015/zone.js:372:25)onInvoke (webpack:///node_modules/@angular/core/fesm2015/core.mjs:26356:32)invoke (webpack:///node_modules/zone.js/fesm2015/zone.js:371:51)run (webpack:///node_modules/zone.js/fesm2015/zone.js:134:42)zone.scheduleMicroTask(source, (webpack:///node_modules/zone.js/fesm2015/zone.js:1275:35)invokeTask (webpack:///node_modules/zone.js/fesm2015/zone.js:406:30)onInvokeTask (webpack:///node_modules/@angular/core/fesm2015/core.mjs:26343:32)scheduleResolveOrReject (webpack:///node_modules/zone.js/fesm2015/zone.js:1211:30)makeResolver (webpack:///node_modules/zone.js/fesm2015/zone.js:1118:16)function (webpack:///node_modules/zone.js/fesm2015/zone.js:1134:32)FormlyMaterialModule (webpack:///node_modules/@ngx-formly/material/fesm2015/ngx-formly-material.js:16:6)invoke (webpack:///node_modules/zone.js/fesm2015/zone.js:372:25)onInvoke (webpack:///node_modules/@angular/core/fesm2015/core.mjs:26356:32)invoke (webpack:///node_modules/zone.js/fesm2015/zone.js:371:51)run (webpack:///node_modules/zone.js/fesm2015/zone.js:134:42)zone.scheduleMicroTask(source, (webpack:///node_modules/zone.js/fesm2015/zone.js:1275:35)invokeTask (webpack:///node_modules/zone.js/fesm2015/zone.js:406:30)
META: SP8.0.0 Electron – de – Linux x86_64 – Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) superProductivity/8.0.0 Chrome/120.0.6099.227 Electron/28.2.0 Safari/537.36

Error Log (Desktop only)

This seems to be pretty much the same as above. The error message seems to permanently repeat.

[2024-02-25 08:18:27.603] [info]  { enabled: null, showDevTools: false, mode: 'bottom' }
[2024-02-25 08:18:28.266] [info]  Saving backups to /home/stefan/snap/superproductivity/1865/.config/superProductivity/backups
[2024-02-25 08:18:29.987] [info]  No custom styles detected at /home/stefan/snap/superproductivity/common/.config/superProductivity/styles.css
[2024-02-25 08:18:37.316] [error] Frontend Error: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at yce (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083499)
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083742
    at Array.forEach (<anonymous>)
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083725
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083757
    at n.repairData (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1090249)
    at n.<anonymous> (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1091668)
    at Generator.next (<anonymous>)
    at u (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1091193) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at yce (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083499)
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083742
    at Array.forEach (<anonymous>)
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083725
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083757
    at n.repairData (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1090249)
    at n.<anonymous> (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1091668)
    at Generator.next (<anonymous>)
    at u (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1091193)

Console Output

This is pretty big but I do not know what to leave out: -1708846074283.log

Meta Info

META: SP8.0.0 Electron – de – Linux x86_64 – Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) superProductivity/8.0.0 Chrome/120.0.6099.227 Electron/28.2.0 Safari/537.36

Stacktrace

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at yce (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083499)
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083742
    at Array.forEach (<anonymous>)
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083725
    at file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1083757
    at n.repairData (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1090249)
    at n.<anonymous> (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1091668)
    at Generator.next (<anonymous>)
    at u (file:///snap/superproductivity/1865/resources/app.asar/dist/main.072f23bff10f4821.js:1:1091193)

Actions Before Error

1708815071368: [Tag] Update Work End for Tag 
1708815071368: [Persistence] Save to DB (3) 
1708815072367: [Task] Add time spent 
1708815072370: [Project] Update Work End 
1708815072372: [Tag] Update Work End for Tag 
1708815072375: [Persistence] Save to DB (3) 
1708815073367: [Task] Add time spent 
1708815073368: [Project] Update Work End 
1708815073368: [Tag] Update Work End for Tag 
1708815073368: [Persistence] Save to DB (3) 
1708815074367: [Task] Add time spent 
1708815074370: [Project] Update Work End 
1708815074371: [Tag] Update Work End for Tag 
1708815074373: [Persistence] Save to DB (3) 
1708815075367: [Task] Add time spent 
1708815075368: [Project] Update Work End 
1708815075368: [Tag] Update Work End for Tag 
1708815075368: [Persistence] Save to DB (3) 
1708815076367: [Task] Add time spent 
1708815076371: [Project] Update Work End 
1708815076372: [Tag] Update Work End for Tag 
1708815076375: [Persistence] Save to DB (3) 
1708815077043: [Task] SetSelectedTask 
1708815077062: [Layout] Hide Notes 
1708815077063: [Task] UnsetCurrentTask 
1708815080064: [Task] Move to archive 
1708815080068: [Persistence] Save to DB (3) 
1708815080068: [Task] UnsetCurrentTask 
1708815080103: [Persistence] Save to DB 
1708845509910: [FocusMode] Set focus session elapsed time
github-actions[bot] commented 4 months ago

Thank you very much for opening up this issue! I am currently a bit overwhelmed by the many requests that arrive each week, so please forgive me, if I fail to respond personally. I am still very likely to at least skim read your request and I'll probably try to fix all (real) bugs if possible and I will likely review every single PR being made (please, give me a heads up if you intent to do so) and I will try to work on popular requests (please upvote via thumbs up on the original issue) whenever possible, but trying to respond to every single issue over the last years has been kind of draining and I need to adjust my approach for this project to remain fun for me and to make any progress with actually coding new stuff. Thanks for your understanding!

sm8ps commented 4 months ago

Upon starting the app again, I was greeted by a notification that I recall having seen in the previous case as well. Screenshot_20240225_083023 The extended error message (cf. above) was shown upon hitting OK.

Unintendedly, I hit the Escape-key and the app restarted. Now all the data is gone! How can I restore it from the backups?

johannesjo commented 4 months ago

@sm8ps sorry to hear this and sorry for the late reply! This should be improved. In fact it might be better to just always execute the the auto fix, at least for the desktop version.

The backup path should be shown under settings and then "Automatic Backups". You can then import the backup under "Import / Export".

Hope this helps!

sm8ps commented 3 months ago

Thanks for your comment, @johannesjo! Due to live I have not had time to have a close look until now. Thanks for the instructions on how to restore from backups. However, I believe that the fix #3052 makes it impossible to start the app with the corrupt data. Indeed, when I open the app, it reports the same error message as before (inconsistent task state: lonely sub task in archive). By hitting OK I get the error window with a red border and the console opened. From there I can only restart the app which takes me back to square one. So currently (with version 8.0.1) there does not seem to be any way to reload the data from the backups. I had to revert to version 8.0.0 in order to solve my problem. As always, thanks for this great app and especially for your great support. Cheers!

johannesjo commented 3 months ago

you need to:

  1. locate the backup and possibly make another copy of it (not strictly necessary, but can't hurt :))
  2. start the app
  3. hit strg+shift+i to open the dev tools
  4. go to application/storage
  5. hit clear site data
  6. hit strg+r to reload the app
  7. within SP you go to settings and import the previously located backup
sm8ps commented 3 months ago

Great, thanks for this very concise instructions! I got SP up and running again and so far it has been performing flawlessly as usual. I have transferred these instructions into a wiki page, OK?

johannesjo commented 3 months ago

I have transferred these instructions into a wiki page, OK?

That's great! Good thinking! Thank you very much!

sm8ps commented 3 months ago

I thank you for your support and the valuable instructions!