dgmid / nextcloud-bookmark-manager

A Mac app for Nextcloud bookmarks
MIT License
72 stars 8 forks source link

2.0.3 has TypeError, not seen in 2.0.2. #17

Closed LnxGnome closed 4 years ago

LnxGnome commented 4 years ago

I upgraded from 2.0.2 to 2.0.3 today. When I start 2.0.3, it generates the error... TypeError: Cannot read property 'text' of undefined. image After you click [ok] to clear that message, the spinner continues indefinitely and no data is shown. I do not see this error in 2.0.2.

dgmid commented 4 years ago

Hi @LnxGnome , What version of the Bookmarks app are you running in Nextcloud?

dgmid commented 4 years ago

I'm running version 3.0.13 of the Bookmarks app, and version 2.0.3 of Bookmark Manager without seeing this error.

Can you have a look at: ~/Library/Application Support/Nextcloud Bookmark Manager/bookmarks.json and let me know what you see for folders. My folders are showing as integers:

"folders": [
    2,
    -1
],

but I've just looked here: https://github.com/dgmid/nextcloud-bookmark-manager/issues/14#issuecomment-614647342 and I can see that your folders are showing as strings:

"folders": [
    "32",
    "-1"
]
LnxGnome commented 4 years ago

Version 2.3.4 of Bookmarks (latest for Nextcloud 16). Was on 2.0.3 of the app when the error occurred, then reloaded 2.0.2.

Looking at 2.0.2's bookmarks.json, yes there are quotes around the folder numbers...

                        "folders": [
                                "271",
                                "-1"
                        ]

If I close 2.0.2, and open 2.0.3 from the dmg... I get the error, and 2.0.3 never stops spinning (never displays any bookmarks). Consequently, bookmarks.json is not updated (config.json is updated).

-rw-r--r--    1 502  20  172499 May 14 23:10 bookmarks.json
-rw-r--r--    1 502  20    2245 May 14 23:18 config.json
dgmid commented 4 years ago

Thanks for all the details - I think I might have identified the problem. Can you look at the config.json file? There should be a list of folders and ids in config.json Are the ids strings or integers?

My guess will be strings (mine are integers with the latest version of the Bookmarks app - 3.0.13).

I have noticed there was a change made to the Folders API endpoint in version 3.0.6 of the Bookmarks app https://github.com/nextcloud/bookmarks/releases/tag/v3.0.6

I think perhaps these ids changed from strings to ints.

dgmid commented 4 years ago

Can you try this patched version and let me know if it resolves the problem? patched version

LnxGnome commented 4 years ago

The folders in config.json are mixed, but the "id" is an integer.

        "folders": [
                {
                        "id": 285,
                        "text": "Other Bookmarks"
                },
                {
                        "id": 259,
                        "text": "日本語"
                },
LnxGnome commented 4 years ago

Can you try this patched version and let me know if it resolves the problem? patched version

404 - page not found

dgmid commented 4 years ago

Sorry! Try this:

patched version!

neilzone commented 4 years ago

Thanks @dgmid — that's solved that bug for me.

dgmid commented 4 years ago

@neilzone Great! -- thanks for the feedback.

dgmid commented 4 years ago

Fixed in v2.0.4 https://github.com/dgmid/nextcloud-bookmark-manager/releases/tag/v2.0.4