Topics Loading at Wrong Post
-
Continuing the discussion from Three Official Likes Threads walk into a bar ... There can be only one.:
NEW BUG!!! (I should probably start a new bug topic on this.)
When recovering from a WSOD (White Screen of Death), the topic often (about 66% of the time) loads well before the last location read AND well before the post ID indicated in the URL.
Further experimentation indicates that the post ID in the URL matches the last location read in these situations. SO Dicsourse is just loading to the wrong position in the topic, sometimes 100 or more posts early.
CC:@Matches
-
I either need some ABBR to be defined, or I need more information what you're trying to point as the bug - since that's basically what happens if you use the back button.
-
Is this a variation of http://what.thedailywtf.com/t/random-jumps-on-topic-load/823/?
-
To replicate:
- Go to the topics page.
- Open a topic in a new tab or window. With varying frequency, this will result in a white screen (aka White Screen of Death or WSOD) loading. Today, I've seen it happen between 1/3 and 1/4 of the time.
- Attempting to open multiple topics at once appears to increase the odds of the WSOD occurring.
- Press Ctrl+R to hard refresh and escape the WSOD.
- If WSOD is still present, return to step 3.
- Sometimes, apparently about 2/3 times, this will cause the topic to load further up than the URL indicates it should. For example, I attempted to open the likes topic, and the URL indicated that I should load at post 21883, but it loaded about 60 posts above that.
-
Is this a variation of http://what.thedailywtf.com/t/random-jumps-on-topic-load/823/?
Maybe? It's hard to say, because it only happens to me when recovering from a WSOD. Keith's bug seems to happen under other conditions as well.
-
I haven't been getting white screens, so can't repro your steps - but this sounds basically identical to every time i use the back button with update URL off.
-
Possibly related bug, if you get the "it failed to load, maybe a connection issue" page when trying to load a topic and click the "Try Again" button, if it actually loads, it takes you to the first post of the topic and not the post it was trying to load into when it got the error page.
-
I haven't been getting white screens, so can't repro your steps - but this sounds basically identical to every time i use the back button with update URL off.
But it is different from that. When you have update URL off and use the back button, you are navigating with a cached URL and the topic loads to the position indicated by the URL. In scenario I am encountering, I am opening a new tab instead of navigating with cached URL and the topic does not load to the post indicated by the URL.
-
If you use the back button, you get dropped where you first entered the topic - NOT what the URL shows.
I can file it later when I do the batch of inserts, but basically
Bad thingstm seem to happen in prolific quantities when discourse shits itself.
-
Hrm, I don't normally open in a new tab in general on Discourse, but testing it, I'm getting the WSOD infrequently, but I also got your bug without the WSOD.
I middle-clicked to open a topic and had it start 50 posts from the last post in the topic (with the last post being the only unread one).
-
Is this related to whether the 'don't mangle history' option is enabled?
-
If you use the back button, you get dropped where you first entered the topic - NOT what the URL shows.
When using the back button, the URL should show where you last entered the topic when you have the URL update disabled. That's been my experience, anyway.
Edit: Yep, just verified. I left this topic from post 12, with the URL indicating post 9. Used the back button, and I was returned to post 9, with the URL indicating post 9.
-
Screenshots of the OP issue:
So here's the WSOD:
Hit Ctrl+R and:
Notice how the URL in the second image points to post 106, but the progress indicator shows 60/106. Also, getting the direct link for the topmost post gives this:
-
See, that I can file.
-
Were you seriously expecting non-WTF reports from this crowd?
-
-
-
This was the most relevant result for WSOD, so posting here - I'll move it if it needs a separate thread for what ever reason.
Paging @sam - 500 error from a 2nd refresh on a WSOD, producing another WSOD, but with the headers if it helps. A 3rd refresh showed the page.
Requst:
GET http://what.thedailywtf.com/t/driving-anti-patterns/3300/526
Request headers:
Host: what.thedailywtf.com User-Agent: Mozilla/5.0 (X11; Linux i686; rv:34.0) Gecko/20100101 Firefox/34.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Referer: http://what.thedailywtf.com/unread Cookie: CommunityServer-UserCookie1001=lv=Fri, 01 Jan 1999 00:00:00 GMT&mra=Sun, 01 Dec 2013 06:50:39 GMT; TDWTF801=elided; CommunityServer-UserCookie8051=lv=Tue, 16 Sep 2014 18:46:52 GMT&mra=Tue, 30 Sep 2014 13:35:10 GMT; __utma=elided; __utmz=elided.utmcsr=what.thedailywtf.com|utmccn=(referral)|utmcmd=referral|utmcct=/; HPDISPALL2=N; _t=elided; _ga=elided; _forum_session=definately_elided; _gat=1 Connection: keep-alive Cache-Control: max-age=0
(Protected?) error log: http://what.thedailywtf.com/logs/show/3dd89ac5027c9ddee4b2991cb392c920 (admins only - the rest of you will get a 404 on that.)
There were a few around that time - mine is the one highlighted:
-
This god damn encoding issue ... rebuilding, but going to patch that method so it outputs something next time this fails ... I need to see no idea where this ascii crap is coming from
-
The possible places are the user input, the database, and the code itself. Of these (based on my experience with watching my colleagues struggle with Rails) I'd expect the code to be the most likely location. Apparently, if you put code in some places inside Rails it is assumed to be UTF-8 and in other places it is assumed to be ISO-8859-1 (or whatever is autodetected according to the host OS, which is why some systems will never see the problem). It's more likely to happen if you're doing anything complex, of course, when Rails stops assuming that you want to do things in a way that actually works sanely.
Or something like that; it's been a while and I wasn't writing the code.
I can't help wondering if the real fix is to monkeypatch the string concatenation code in Ruby to actually use UTF-8 as a pivot encoding, but that sort of approach (a nauseating hack to fix something that should never have been broken in the first place) would be TRWTF…
-
The possible places are the user input, the database, and the code itself.
Well the WSOD is not easily reproducible. My previous post was based on 3 attempts at loading a page that had unread posts:
Attempt 1: WSOD
Attempt 2: Fire up FF's Tools and refresh page. Another WSOD. Grab screenshot, request et alia.
Attempt 3: Refresh page again. Success.I think that rules out user input (either mine, or others' already present,) the database (for the same reasons) leaving code.
WSOD's seem to occur when the site is busy, so I'm guessing race conditions in the code somewhere...
-
Categories do have two different views, maybe one is utf8 and the other is not?
-
Categories do have two different views, maybe one is utf8 and the other is not?
And maybe some of the files have a magic incantation to fix them and others don't. It can all be incredibly path dependent. (I already voted for Ruby to be @mikeTheLiar of programming languages, and I didn't do it just to troll people…)
-
OK I put a workaround in place to log the issue and mess with data so it still renders if encoding goes nuts
White screen issue should be gone now, but we should monitor logs to find the culprits.
-
but we should monitor logs to find the culprits.
These?:
There's an awful lot of them for what is a typically quiet time of day for the forums...
-
Hm. I’m pretty sure my title is valid UTF-8. I know this because I tried to submit invalid UTF-8, and it failed.
-
default encoding could have somehow switched due to a rogue gem or something, will add more diags ... on the upside no whitescreens.
-
Try deploying this once tests pass, more diagnostics:
-
default encoding could have somehow switched due to a rogue gem or something
My point from earlier stands.
Ruby [is the] @mikeTheLiar of programming languages
-
My point from earlier stands.
Encoding bullshit in Ruby is a train wreck, it happened cause it was retrofitted in Ruby 1.9
-
-
What about the OP issue in this topic (clarified here)? Since then, it has been confirmed that the loading issue is not restricted to just after a WSOD.
-
@Sam - WSOD - or something like it: http://what.thedailywtf.com/logs/show/d8a7b360f0ef16a9e6de2c28fffa366d
Was ok on a refresh.
-
To me the logs suggest issues with user real name field encoding.
Or more accurately, the encoded names are making it choose the wrong character encoding.
-
love how my name is smack in the middle of that list
-