floccusaddon / floccus

:cloud: Sync your bookmarks privately across browsers and devices
https://floccus.org
Mozilla Public License 2.0
5.56k stars 235 forks source link

error sync with unicode emoji in bookmark's title #648

Closed belgotux closed 4 years ago

belgotux commented 4 years ago

Describe the bug I've try to do the first synchronisation with an empty nextcloud bookmarks and a lot for bookmarks on Firefox.

To Reproduce Steps to reproduce the behavior:

  1. I install the floccus module to firefox, add url and credentials. Don't put any entry in Foldermapping and save.
  2. Manually run the first sync now
  3. floccus said the sync is done, but nothing in the nextcloud bookmarks (I've done ctrl+F5) The log is attached floccus-4.3.0-2020-08-28.log.txt I've seen that the server path is empty by default (/ in grey).

After that, I've try to modify server path to "/perso". And work well create a "perso" directory to the root of nextcloud bookmarks. After that another think :

  1. I remove account, remove module, readd it and create a new app password to connect to nextcloud.
  2. set "/" to the server path
  3. Manually run the first sync now
  4. The sync work but a blank folder appears on the root folder of nextcloud bookmarks. I expected the content at the root folder, not create a "no name" folder image

Expected behavior Sync the bookmarks on firefox to the root directory of nextcloud bookmarks.

Desktop (please complete the following information):

Server (please complete the following information):

Debug log log of the first try : floccus-4.3.0-2020-08-28.log.txt

I can do other test if needed, ask me.

I'll doing a review on my blog for your great module after all my test ;)

marcelklehr commented 4 years ago

I think the problem is that floccus by default creates an empty folder on the client side that it syncs. And that is initially empty, of course. So, you'll have to explicitly set the local folder when setting up sync.

I'll doing a review on my blog for your great module after all my test ;)

Awesome! :)

belgotux commented 4 years ago

Can't possible to sync on the root folder of nextcloud bookmarks ? Because inside this blank folder, only two folders : bookmarks bar and bookmarks menu. Now A big part of my bookmarks is sync (it takes time the first time, I've too many bookmarks -_-), but stopped after 3936 bookmarks. Here the error and I've send you by your secure link the logfile(floccus-4.3.0-2020-08-28.log-2.txt). I've seen nothing wrong. Maybe special characters in name ? image

marcelklehr commented 4 years ago

Maybe special characters in name ?

That could be. Can you check the nextcloud log for errors? Also, it might help to check what exactly is returned on that request that cannot be parsed. See below for a how-to.

How to debug network #### Firefox * Go to `about:debugging` * click on `debug` button next to floccus entry * go to the network tab in the inspector tab * trigger a sync by clicking on `sync now` for the account of your choice. * check the failing network requests #### Chrome * Go to `chrome://extensions` * enable `Developer mode` * click on `dist/html/background.html` button in floccus' entry next to "Inspect views: " * go to the network tab in the inspector window * trigger a sync by clicking on `sync now` for the account of your choice * check the failing network requests
belgotux commented 4 years ago

Hello,

Sorry for the delay, no time, big production release this weekend.

I've time today and I've seen the error. It's the string of the title from the website https://wificard.bdw.to/

I've attached the full nextcloud log in your shared space, you can see the 500 error during the POST at line 168. I've done a debug on the plugin (use it for work but I don't knowed this for a plugin) curl "https://xxx/index.php/apps/bookmarks/public/rest/v2/bookmark" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" -H "Accept: */*" -H "Accept-Language: fr,fr-FR;q=0.8,be-FR;q=0.6,en-US;q=0.4,en;q=0.2" --compressed -H "Content-type: application/json" -H "Authorization: Basic ZzpDWHpyei14R01QTS16UHlabS13NEE5ai1HbVdSaw==" -H "Origin: moz-extension://4d2e7b87-982d-4eaa-b46c-75b711324eb3" -H "DNT: 1" -H "Connection: keep-alive" -H "TE: Trailers" --data-raw "{""url"":""https://wificard.bdw.to/"",""title"":""📡 WiFi Card qrcode"",""folders"":[460]}"

request just before is maybe relevent too : curl "https://xxx/index.php/apps/bookmarks/public/rest/v2/bookmark" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" -H "Accept: */*" -H "Accept-Language: fr,fr-FR;q=0.8,be-FR;q=0.6,en-US;q=0.4,en;q=0.2" --compressed -H "Content-type: application/json" -H "Authorization: Basic ZzpDWHpyei14R01QTS16UHlabS13NEE5ai1HbVdSaw==" -H "Origin: moz-extension://4d2e7b87-982d-4eaa-b46c-75b711324eb3" -H "DNT: 1" -H "Connection: keep-alive" -H "TE: Trailers" --data-raw "{""url"":""https://wificard.bdw.to/"",""title"":""📡 WiFi Card qrcode"",""folders"":[460]}"

I've modified the name of the bookmarks and it works until the next error with https://sploitus.com/

curl "https://xxx/index.php/apps/bookmarks/public/rest/v2/bookmark" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" -H "Accept: */*" -H "Accept-Language: fr,fr-FR;q=0.8,be-FR;q=0.6,en-US;q=0.4,en;q=0.2" --compressed -H "Content-type: application/json" -H "Authorization: Basic ZzpDWHpyei14R01QTS16UHlabS13NEE5ai1HbVdSaw==" -H "Origin: moz-extension://4d2e7b87-982d-4eaa-b46c-75b711324eb3" -H "DNT: 1" -H "Connection: keep-alive" -H "TE: Trailers" --data-raw "{""url"":""https://sploitus.com/"",""title"":""💀 Sploitus | Exploit & Hacktool Search Engine"",""folders"":[554]}"

I think it's the new unicode emoji done problem with floccus.

Bug identified, 90% of the work is done :p

belgotux commented 4 years ago

I've rename the title for the true bug, the first error was a feature chose ;)

marcelklehr commented 4 years ago

Try this: https://github.com/marcelklehr/floccus#troubleshooting

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.