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

pocket_modify kind of always returns true #26

Open
pr130 opened this issue Mar 14, 2020 · 3 comments
Open

pocket_modify kind of always returns true #26

pr130 opened this issue Mar 14, 2020 · 3 comments
Labels
question Further information is requested

Comments

@pr130
Copy link
Contributor

pr130 commented Mar 14, 2020

the pocket API kind of always returns "success" for pocket_modify actions.
For example, even if the item id does not exist, the returned list looks like this:

{
    "action_results": [
        true
    ],
    "action_errors": [
        null
    ],
    "status": 1
}

Other weird behaviour is not known but could exist (do further probing?)

Options are:

  • put a warning in the docs for all functions that work through modify.
  • pre-check: before running the code, fetch pockets and evaluate whether the query could succeed.
  • after-check: check whether the target state has been achieved.
@pr130 pr130 added the question Further information is requested label May 7, 2020
@pr130
Copy link
Contributor Author

pr130 commented May 7, 2020

what do you think?

@yannikbuhl
Copy link
Contributor

There is another weird behaviour. When you are doing the pocket_add() with multiple links (or only with one, it doesn't matter), it only works if you put an http://www in front of your link. But if you don't, no error message is returned by the HTTP request.

Possible solution: Check if string of URL starts with http:// or https:// and add it otherwise. Dipslay warning, too.

@yannikbuhl
Copy link
Contributor

Fixed problem for pocket_add() by adding a helper function that compares the URLs desired for adding with the list of URLs in the Pocket and prompts a warning if some of them have not been added.

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

No branches or pull requests

2 participants