DigitalDJ / tinytinyrss-fever-plugin

Tiny Tiny RSS Fever API Plugin
https://github.com/DigitalDJ/tinytinyrss-fever-plugin
GNU General Public License v3.0
207 stars 28 forks source link

Doesn't work with Press on Android #8

Closed garryforreg closed 4 years ago

garryforreg commented 5 years ago

E_ERROR (1) | plugins.local/fever/fever_api.php:578 | Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /volume2/web/tinyrss/plugins.local/fever/fever_api.php:578 Stack trace: #0 /volume2/web/tinyrss/plugins.local/fever/fever_api.php(578): PDOStatement->execute(Array) #1 /volume2/web/tinyrss/plugins.local/fever/fever_api.php(893): FeverAPI->getItems() #2 /volume2/web/tinyrss/plugins.local/fever/index.php(70): FeverAPI->index() #3 {main} thrown

E_WARNING (2) | include/functions.php:2543 | str_repeat(): Second argument has to be greater than or equal to 01. include/functions.php(2543): str_repeat(?,, -1)2. plugins.local/fever/fever_api.php(535): arr_qmarks(Array)3. plugins.local/fever/fever_api.php(893): getItems()4. plugins.local/fever/index.php(70): index()

corneliuskopp commented 5 years ago

I run into the same problem, here are some details:

Incoming requests by press

I run TT-RSS in a docker container, behind an nginx reverse proxy; there are entries from nginx' access log:

"POST /tt-rss/plugins.local/fever/?api&groups HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&feeds HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&unread_item_ids HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&items&since_id=101 HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&items&since_id=151 HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&items&since_id=201 HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&items&since_id=251 HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&unread_item_ids HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&saved_item_ids HTTP/1.1" 200
"POST /tt-rss/plugins.local/fever/?api&items&with_ids= HTTP/1.1" 200

In previous incarnations I've seen the latter returning 500.

After enabling PHP error logging and cURLing the last one locally, I get the same errors that garry sees; dumping the WHERE clause and the injected arguments yields:

WHERE: owner_uid = ? AND ref_id = id AND id IN (?) LIMIT 50 ARGS: 2

I'm not sure if Press is following convention or spec with this kind of request, or if Press needs to be updated. Having said that, some searching around the internet suggests that Press updates at a somewhat glacial pace, and I can't even find it on the play store at the moment.

I've installed "Readably" instead, and it could sync my articles instantly.

objp4th commented 5 years ago

When updating my TTRSS instance and Fever plugin I ran into the same problem. Press no longer worked.

Adding the exception handling for the PDO call fixes the problem and makes Press happy as the HTTP return code then remains 200 and no longer bails out as before (500).

The solution https://github.com/objp4th/tinytinyrss-fever-plugin/commit/488530ea38627f1be1f52e7be9b4cd8ef4d2520c is straight forward, pull request submitted.

subvillion commented 5 years ago

Problem NOT with press app, problem with broken fever api plugin, ex: #13, #7 I'm used https://miniflux.app/ with fever api enabled and Press, works like a charm