Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'entities') #3638

Open
jin-xi-arch opened this issue Oct 28, 2024 · 12 comments
Open

Comments

@jin-xi-arch
Copy link

I have tried many similar applications before, and this one is the best I've used. It has greatly facilitated my work, so kudos to the developer. However, I recently encountered an unsolvable issue on the Linux desktop version and am unsure how to fix it. I hope the developer can help. Nevertheless, I still really like this software.

Steps to Reproduce

  1. Add some modifications to my Linux device and set up WebDAV sync to the server.
  2. Set up WebDAV sync on my Android device for downward data synchronization.
  3. Add some modifications to my Android device and perform WebDAV synchronization.
  4. My Linux device attempts to sync down from WebDAV, but the error appears, preventing synchronization.
  5. Then I tried to download MAIN.json on my WebDAV server, delete .config/superProductivity and import data from MAIN.json.(Because it is similar with the exported data) Then this error appears(details are as below).
    image
    This means "Detected old data while importing. Try to move(?) it? ( I pressed "Ok" here)
    image
    This means "Your data seem to be damaged. Try to repair it automaticly? This may cause some data loss. (I pressed "Ok" here)
    image

Error Log (Desktop only)

main.log

Console Output

image
image
image

Meta Info

META: SP10.0.11 Electron – zh-CN – Linux x86_64 – Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) superProductivity/10.0.11 Chrome/128.0.6613.162 Electron/32.1.2 Safari/537.36

Stacktrace

taskIdsToRestoreFromArchive.includes (file:///opt/superProductivity/resources/app.asar/dist/browser/src/app/core/data-repair/data-repair.util.ts:230:20)
_fixEntityStates (file:///opt/superProductivity/resources/app.asar/dist/browser/src/app/core/data-repair/data-repair.util.ts:45:16)
_fixEntityStates (file:///opt/superProductivity/resources/app.asar/dist/browser/src/app/core/data-repair/data-repair.util.ts:44:20)
isDataRepairPossible (file:///opt/superProductivity/resources/app.asar/dist/browser/src/app/core/data-repair/data-repair.util.ts:22:12)
constructor (file:///opt/superProductivity/resources/app.asar/dist/browser/src/app/core/data-repair/data-repair.service.ts:17:11)
this._dataRepairService.isRepairPossibleAndConfirmed (file:///opt/superProductivity/resources/app.asar/dist/browser/src/app/imex/sync/data-import.service.ts:117:48)
h_ (file:///opt/superProductivity/resources/app.asar/dist/browser/main-DUZ4F2RX.js:1:1557)
invoke (file:///opt/superProductivity/resources/app.asar/dist/browser/node_modules/zone.js/fesm2015/zone.js:331:157)

Actions Before Error

1730118437458: [FocusMode] Set focus session elapsed time 
1730118437566: [SP_ALL] Load(import) all data 
1730118437570: [SP_ALL] All Data was loaded 
1730118441493: [Layout] Toggle SideBar 
1730118446098: [Layout] Hide SideBar (2) 
1730118454380: [Persistence] Save to DB
Copy link

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!

Copy link

Hello there Jin-xi-bit! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀

For more open ended discussions and/or specific questions, please visit the discussions page. 💖

@johannesjo
Copy link
Owner

Thank you very much for reporting! I try to have a look this Friday.

@jin-xi-arch
Copy link
Author

I just discovered that there are some differences between the MAIN.json file uploaded via WebDAV and the super-productivity-backup.json file exported using the "Export Data" feature within the app. This is the reason for the error message mentioned earlier, so there’s no need to check the initial error report I submitted. I only need to overwrite the differing content (just some metadata differences) in MAIN.json, and I can successfully import data using the "Import from File" feature from MAIN.json.

However, after completing WebDAV synchronization on both ends, once I submit a change from the Android side, an error occurs when the Linux desktop side syncs via WebDAV (choosing the remote version in case of conflicts). This issue significantly affects desktop usage. I recreated the data and found that this process can consistently trigger the error. Additionally, I attempted to switch from the Linux desktop version to the web version, but a similar error (an unknown error) occurs with a different error page.

This is the error message at the Linux desktop side.
image

This is my first time submitting an issue on GitHub. I'm very grateful that, even though I'm just an ordinary user, you're still willing to take the time to address my issue.

@HalgrimThadeus
Copy link

Could it be linked to the bug i mentioned in the android repo? #johannesjo/super-productivity-android#54 -just a reminder, that maybe helps debugging-

@jin-xi-arch
Copy link
Author

Could it be linked to the bug i mentioned in the android repo? #johannesjo/super-productivity-android#54 -just a reminder, that maybe helps debugging-

Our data synchronization directions are opposite and my error occurs at the Linux Desktop (not Android App). But both occur during WebDAV synchronization, so there might be some connection.

@johannesjo
Copy link
Owner

Unfortunately I am unable to reproduce this myself. Does it help if you delete the remote data once completely manually?

The error above indicates that the revision id for your archive data saved on android is not correct for some reason (it should never be just a date).

Possibly related #3617 #3641

@jin-xi-arch
Copy link
Author

jin-xi-arch commented Nov 2, 2024

Yes, it helps me. Thank you. There are all steps to fix my problem.

  1. Download remote files (MAIN.json and ARCHIVE.json) and completely remove them on my WebDAV server.
  2. Uninstall my android app to clear any remaining data (which I've never tried before).
  3. (Don't do this step unless you also removed data on the Linux device without any backup.) Combine remote files into a complete backup file manually and imported it to the Linux device.
  4. Upload data from the Linux device.
  5. Reinstall app at the Android device and configure WebDAV sync.

I still have no idea why this problem occured before. Anyway, the problem have been fixed.

@johannesjo
Copy link
Owner

I am glad that it works now. Might be some bug from an earlier version that led to a wrong value for the rev. Glad that it works know and I am sorry for the inconvenience!

@jin-xi-arch
Copy link
Author

jin-xi-arch commented Nov 3, 2024

Unfortunately, when I get up at today's morning, this problem occurs again.
image
The last thing I did last night was finish a last day with my Android device (I'm sure I synced it) at around 23:50. This morning, I opened my Linux device and tried to sync from remote, and this happened.

There might be some bugs in current version since I just start to use it at version 10.0.11 last week. So it's not because of any earlier version.

Now I turn to use "Local File" to sync and use other apps to sync this local file (without deleting any data). And it works.

@johannesjo
Copy link
Owner

johannesjo commented Nov 4, 2024

To me this looks like that the responses from the web dav server are a bit inconsistent. Super Productivity gets the rev by this logic from the response header:

    const rev = meta.etag || meta['oc-etag'] || meta['last-modified'];

It seems at point of uploading the data and saving the rev of the archive file to the main file (mfRef => mainFileRev) there was only last-modified available. But then later when importing the data etag or oc-etag was available in the response header. Not really sure if there is a good way to deal with this inconsistency from Super Productivity's side of things... But I'd welcome any suggestion!

@vincurekf
Copy link

vincurekf commented Nov 7, 2024

I had this error after unexpected restart. It seems that the Import from file function expects to get complete backup file including taskArchive which I had in separate file (I had two files MAIN.json and ARCHIVE.json). When I merged these files and then imported the merged file the import was successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants