kiliankoe / readnow

📖 open a random link from your Safari reading list
10 stars 1 forks source link

Decodable error on macOS Mojave #4

Open slashmo opened 6 years ago

slashmo commented 6 years ago

When I'm running readnow on macOS Mojave some data can't be decoded. I've already given access to the application data as described in the README.

The exact error message is:

Error occured: The data couldn’t be read because it is missing.

kiliankoe commented 6 years ago

Interesting, I have no clue where that's coming from 🙈 But since I've only ever tried this on my machine (Mojave Beta 6, Safari 12.0), I'm sure there's other configurations.

If you want to debug this further, you could build readnow from source and change the following line to not only output the localizedDescription. Hopefully that will lead to some more insight into where exactly this is failing 😅

https://github.com/kiliankoe/readnow/blob/11b74770a7af11a1da6950bb380dcc881c41f898/Sources/readnow/main.swift#L15

slashmo commented 6 years ago

Printing the entire error gives me this:

keyNotFound(CodingKeys(stringValue: "URLString", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "Children", intValue: nil), _PlistKey(stringValue: "Index 4", intValue: 4), CodingKeys(stringValue: "Children", intValue: nil), _PlistKey(stringValue: "Index 0", intValue: 0)], debugDescription: "No value associated with key CodingKeys(stringValue: \"URLString\", intValue: nil) (\"URLString\").", underlyingError: nil))

kiliankoe commented 6 years ago

Ah, so apparently URLString can be optional? No clue why, but in that case that should be updated I guess. Do you have any super weird entries on your reading list? 😄

slashmo commented 6 years ago

Nope, I deleted my entire reading list and got the same error. 😁

kiliankoe commented 6 years ago

I just made Item.URLString optional, maybe that fixes things? Would you mind trying it out (it's on the branch fix-4) if you have time? 😊

slashmo commented 6 years ago

It didn't fix the tool for me, but at least there now is a different error message 😀

Error occurred: The operation couldn’t be completed. (Swift.String error 1.)