"Toggle Un/read" results in undefined ref_id after commit c8919d6

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
User avatar
digitalcircuit
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Jan 2017, 03:05

"Toggle Un/read" results in undefined ref_id after commit c8919d6

Postby digitalcircuit » 16 Feb 2017, 20:18

Ever since updating in the past few days, I've noticed trying to toggle un/read status via right-click article in the web interface results in an error...

Log entry on trying to toggle un/read status

Code: Select all

E_USER_ERROR (256)   classes/db/pgsql.php:47   Query SELECT DISTINCT feed_id FROM ttrss_user_entries WHERE (ref_id = 'undefined') AND owner_uid = 2 failed: ERROR: invalid input syntax for integer: "undefined" LINE 2: WHERE (ref_id = 'undefined') AND owner_uid = 2 ^
1. classes/db/pgsql.php(47): user_error(Query SELECT DISTINCT feed_id FROM ttrss_user_entries
WHERE (ref_id = 'undefined') AND owner_uid = 2 failed: ERROR: invalid input syntax for integer: "undefined"
LINE 2: WHERE (ref_id = 'undefined') AND owner_uid = 2
^, 256)
2. classes/db.php(66): query(SELECT DISTINCT feed_id FROM ttrss_user_entries
WHERE (ref_id = 'undefined') AND owner_uid = 2, 1)
3. include/db.php(8): query(SELECT DISTINCT feed_id FROM ttrss_user_entries
WHERE (ref_id = 'undefined') AND owner_uid = 2, 1)
4. include/functions2.php(1122): db_query(SELECT DISTINCT feed_id FROM ttrss_user_entries
WHERE (ref_id = 'undefined') AND owner_uid = 2)
5. classes/rpc.php(314): catchupArticlesById(Array, 2)
6. backend.php(123): catchupSelected()


This is interspersed with the following, happening less often (not yet sure what causes it).

Related log entries (less often)

Code: Select all

E_WARNING (2)   classes/db/pgsql.php:53   pg_fetch_assoc() expects parameter 1 to be resource, boolean given
1. classes/db/pgsql.php(53): pg_fetch_assoc()
2. classes/db.php(70): fetch_assoc()
3. include/db.php(12): fetch_assoc()
4. include/functions2.php(1124): db_fetch_assoc()
5. classes/rpc.php(314): catchupArticlesById(Array, 2)
6. backend.php(123): catchupSelected()


I've tried running git bisect with refreshing the page and testing each time, which results in the following:

Code: Select all

[...]$ git bisect start a3b5f3817e810257256e74b1116cf8da2e91e1b7 3891782cf5fc20dc70e17c8665866aef6392233e
Bisecting: 10 revisions left to test after this (roughly 3 steps)
[093d463320a86b14ebc182da2e1499c47a3edb91] af_zz_imgproxy: truncate url in error png
[...]$ git bisect good
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[79ec2f3efd9a4675e58a96171aa5ae01e54afe2c] set error report url to https
[...]$ git bisect good
Bisecting: 2 revisions left to test after this (roughly 2 steps)
[f75cf64673a9db014244b524e32664b1a07cada8] Merge branch 'german-translation' into 'master'
[...]$ git bisect good
Bisecting: 0 revisions left to test after this (roughly 1 step)
[c8919d630e4e4c9bc663f5db95fd01e17d09f7f4] Merge branch 'master' of git.tt-rss.org:fox/tt-rss
[...]$ git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[c55fb22bcdca061146403af2462b73945c61d563] af_zz_imgproxy: rewrite to absolute url; add on-parse article filter hook to handle redirect situation in case frontend has  open_basedir (disabled currently)
[...]$ git bisect good
c8919d630e4e4c9bc663f5db95fd01e17d09f7f4 is the first bad commit


It doesn't make sense to me for a merge commit to cause the issue. I might've not run git bisect correctly.

I can reliably reproduce this and easily test it. If there's any further steps I should take to troubleshoot, let me know!

System details
  • TinyTiny-RSS 3102a1b3 (git from tt-rss.org GitLab)
  • nginx 1.10.0-0ubuntu0.16.04.4
  • PostgreSQL 9.5.5-0ubuntu0.16.04
  • PHP 7.0.13-0ubuntu0.16.04.1
  • Ubuntu 16.04 x86_64, Intel

nginx logs
Nothing seemingly relevant shows up; it's the same for success and failure, just different lengths.

Code: Select all

192.168.0.11 - - [16/Feb/2017:11:09:19 -0600] "POST /rw/tt-rss/backend.php HTTP/2.0" 200 22652 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0"

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: "Toggle Un/read" results in undefined ref_id after commit c8919d6

Postby fox » 16 Feb 2017, 20:52

the only recent change related to context menu was this: https://tt-rss.org/gitlab/fox/tt-rss/co ... f936956f15

it could've broke this but unfortunately i can't reproduce your problem. can you post a screenshot and elaborate on what exactly and where you're clicking?

also, open browser error console and see if there's anything of interest there.

e: i have no idea how to use git bisect so usually i just checkout some earlier changeset, see if stuff starts working and go from there.

e2: also try emptying javascript cache

User avatar
digitalcircuit
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Jan 2017, 03:05

Re: "Toggle Un/read" results in undefined ref_id after commit c8919d6

Postby digitalcircuit » 17 Feb 2017, 04:36

After about 2 hours, I'm thoroughly confused as to what's working and what's not.

Time permitting, I'll try to track this down further in the near future. For now, here's what I found, an assortment of information that may or may not be helpful.

--------------------------------------------------

In the process of repeating my steps, recording with Firefox's Network inspector open, I've found that the "Toggle unread" option works sometimes on 'master'. Now there's three observed outcomes:

Screenshot
Toggling unread status via the article header right-click menu, widescreen mode, with Firefox network tools open showing the request.
https://zorro.casa/go/db/Hosting/Utilit ... 73bf7e.png

Setup
  1. Open TinyTiny RSS
  2. Turn on widescreen mode (haven't yet reproduced it in non-widescreen mode)
  3. Have multiple feeds subscribed so "All Articles" view has a mix of read and unread, more than a single page
  4. Open an article
  5. Try toggling the unread status of the selected article or other articles

With 3102a1b (git master)

  1. Toggle unread toggles the correct right-clicked article title, no SQL errors
  2. Toggle unread toggles a different right-clicked article title, one or two articles above or below, no SQL errors
  3. Toggle unread fails to change anything, SQL error in log

Scenario 1: working
This one toggles correctly. See the article titled Working with The Current ODFAuthors Site in the screenshot, with this feed URL. Of note, this article isn't always handled correctly, it just happened to around when I took the screenshot.

This seems to vary as I scroll up and down, toggling working correctly every 3-7 items.

Scenario 2: toggling other
Happens roughly 70% of the time, toggling some article above or below instead of the right-clicked article. The network request and JavaScript call to selectionToggleUnread() has the wrong article ID, possibly originating from getSelectedArticleIds2(). The "data-article-id" tag is correct in the generated HTML.

Scenario 3: SQL error
I can't yet figure out what causes this. It happened once more during testing, but I didn't pin down a repeatable example. It might be related to the above scenarios.

Reloading TinyTiny-RSS and toggling unread status without scrolling seems to trigger it more often.

With 3eec1de (several days ago, commit before the one you referenced)
The toggling unread issue still occurs.. somehow? The SQL error doesn't happen often (if at all, unsure).

Theories
Some sort of article ID isn't properly getting passed from the dijit menu handler down to the toggle selection unread function.

When the wrong article is toggled, according to the JavaScript debugger selectionToggleUnread() is given the wrong ID (e.g. right-click article 28830, it toggles correctly, then right-click article 28829, it still passes the ID 28830).

Right-clicking various articles, scrolling, then repeating tests shifts around which articles are getting toggled and which ones aren't. I suspect it relates to where the mouse is being right-clicked.

I'm not really sure why this changed from my original report. I apologize for the hassle.

EDIT 2017-2-16 7:37 pm: Ack, I should've re-read your post before posting. Whenever I changed the git checkout, I force-refreshed with Ctrl-F5, which unfortunately doesn't seem to help. Nginx isn't doing any fancy caching, either. Noted on git bisect! I'll need to practice with it.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: "Toggle Un/read" results in undefined ref_id after commit c8919d6

Postby fox » 17 Feb 2017, 08:33

looks like something specific to widescreen mode, i think

e: the way menu row id was identified wasn't working quite right on widescreen mode. i've changed it as per dijit documentation and it seems to be working properly now. not sure why it was implemented this way in the first place tbh, maybe because of some old dojo version years ago (or maybe because i couldn't figure out how to do this properly).

User avatar
digitalcircuit
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Jan 2017, 03:05

Re: "Toggle Un/read" results in undefined ref_id after commit c8919d6

Postby digitalcircuit » 17 Feb 2017, 21:47

I've tried a variety of articles and scrolling, and all seems to work properly. If the SQL error returns, I'll file a separate issue; for now, I'll assume it was caused by the menu issues.

Thank you for looking into this!


Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests