spamwax / alfred-pinboard-rs

Alfred Workflow for Pinboard (Rust)
Other
280 stars 13 forks source link

Can't load bookmarks: deserialization error #2

Closed jberkel closed 6 years ago

jberkel commented 6 years ago

v0.10.10

$ ./alfred-pinboard-rs config -a [...]
$ ./alfred-pinboard-rs update
{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"serde error: invalid type: boolean `false`, expected a string at line 1964 column 60","title":"Error"}]}[

posts/all, line 1964:

 {"href":"http:\/\/www.dialektkarte.de\/","description":false,"extended":"German dialects. Click on a pin on the  map and hear speaker from that part of Germany","meta":"04cb556fa05daff3fb210eb2906d46c3","hash":"8fe8b63d7fcf5428385bfe0031f1bb33","time":"2016-01-29T16:29:05Z","shared":"yes","toread":"no","tags":""},

There was only one bookmark with a false description. Looking at the API docs the type is string, so it must be a type anomaly on the server. I deleted it and got the next error:

{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"serde error: relative URL without a base at line 5634 column 12","title":"Error"}]}
{"href":"\/","description":"","extended":"","meta":"a72a1627a6211c18fcc90f4aefd9b842","hash":"6666cd76f96956469e7be39d750cc7d9","time":"1970-01-01T00:00:00Z","shared":"yes","toread":"no","tags":""}]

Unfortunately I can't delete this one bad entry (and it doesn't show in the web interface):

$ curl -v 'https://api.pinboard.in/v1/posts/delete?format=json&auth_token=[...]&url=%2F'
{"result_code":"item not found"}
spamwax commented 6 years ago

Thanks for the report, appreciated. I'll look into this soon

spamwax commented 6 years ago

Can you please use this updated workflow and run the above commands again: https://www.dropbox.com/s/3zcw9048k6hql0l/AlfredPinboardRust.alfredworkflow?dl=0

To see how many bookmarks cannot be correctly converted use this:

RUST_LOG=rusty_pin=debug,alfred_pinboard_rs=debug ./alfred-pinboard-rs update

There should be an INFO line that says "couldn't parse 3 bookmarks"

You can get the same logging from within Alfred when you open this workflow's debug window.

jberkel commented 6 years ago
 INFO 2018-04-14T05:28:16Z: rusty_pin::pinboard::api: couldn't parse 1 bookmarks

it works now, thanks!

unrelated, but I'd be interested to hear your opinion on rust vs go, since you reimplemented the whole project (I used the go version previously)

spamwax commented 6 years ago

Thanks for testing.

Learning from go version obviously made this codebase better but in general