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

Handle rare items with empty or invalid URL #19

Closed
wedens opened this issue Dec 13, 2019 · 10 comments · Fixed by #23
Closed

Handle rare items with empty or invalid URL #19

wedens opened this issue Dec 13, 2019 · 10 comments · Fixed by #23
Assignees
Labels

Comments

@wedens
Copy link

wedens commented Dec 13, 2019

When I start pocket-reader, I get replace-regexp-in-string: Wrong type argument: arrayp, nil error.

I tried to re-authorize, but after re-authorizing the issue persists.

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  substring(nil 0 0)
  replace-regexp-in-string("\\`\\(?:amp\\|www\\)\\." "" nil)
  pocket-reader--url-domain("")
  pocket-reader--get-url(#<hash-table eq 21/65 0x157848926b89>)
  pocket-reader--add-items((... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
  pocket-reader-search(nil)
  pocket-reader-refresh()
  pocket-reader-mode()
  pocket-reader()
  funcall-interactively(pocket-reader)
  call-interactively(pocket-reader nil nil)
  command-execute(pocket-reader)

Emacs version: master (5a3e96b17c2a948ac952295962dc6e281ec5cad5).
Latest pocket-reader version.

@alphapapa
Copy link
Owner

That would seem to indicate that one of your Pocket items has an empty URL string, which is strange. I suppose we should account for that possibility, but it ought to be extremely rare, and might indicate a mistake on Pocket's end at some time in the past (e.g. when the item was added).

@wedens
Copy link
Author

wedens commented Dec 14, 2019

Yes, you're right. I've found an item in pocket web ui that doesn't display any url (but it still opens the page if try to). Removing this item makes pocket-reader usable again.

I'll let you decide whether to close the issue now or when/if you'd like to add a workaround.

Thanks!

@wedens
Copy link
Author

wedens commented Dec 14, 2019

Btw, the problem is reproducible with this page https://www.javiercasas.com/articles/codata-in-action.

@alphapapa alphapapa changed the title Error: wrong-type-argument arrayp nil Handle rare items with empty or invalid URL Dec 21, 2019
@alphapapa alphapapa self-assigned this Dec 21, 2019
@alphapapa alphapapa added the bug label Dec 21, 2019
@alphapapa
Copy link
Owner

Thanks, I'll look into adding checks for this.

Btw, the problem is reproducible with this page https://www.javiercasas.com/articles/codata-in-action.

Sorry, I don't understand what you mean.

@wedens
Copy link
Author

wedens commented Dec 22, 2019

Sorry, I don't understand what you mean.

If you add this page to the pocket, you'll get this problem in pocket-reader.el.

@alphapapa
Copy link
Owner

Add it to Pocket how? With what software?

@wedens
Copy link
Author

wedens commented Dec 22, 2019

Official web page https://app.getpocket.com/ will add it without an url or whatever makes it broken.

@alphapapa
Copy link
Owner

Have you reported that bug to Pocket?

@wedens
Copy link
Author

wedens commented Dec 23, 2019

No. Even though it seems to be wrong, it works fine in their official web and android client. So, unless it's some API specification violation, they may not consider it an issue on their side :/

@alphapapa
Copy link
Owner

Isn't app.getpocket.com an official Web client? If it saves an entry with an empty URL, that's definitely a bug in their code.

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

Successfully merging a pull request may close this issue.

2 participants