Pony-bug? Bug-Pony? October 4, 2018 2:23 AM   Subscribe

I’m not sure if this is a pony request or a bug report.... I often browse through AskMe by clicking repeatedly on the random button. On a desktop (using Chrome, modern theme), when I hit “back,” it takes me to last random thing I was looking at. On my phone (iPhone 8, modern theme), when I hit “back,” it takes me back to the last place I was before I started hitting the random button. Is this just me? I would prefer the desktop way.

It’s annoying because I sometimes reconsider if I want to read something as I’m clicking for the next one, but when I’m on my phone (most of the time) that page is now lost into the ether.

Is this a Metafilter thing? Or an iPhone/Safari thing? Can you help? Or is there a setting on my phone that I should change? Or do I just need to click more thoughtfully?

Thanks!
posted by Weeping_angel to Feature Requests at 2:23 AM (16 comments total)

Huh. Yeah, that is an odd one, and I'd definitely say that not having the random sites in your history isn't how it should work.

I've poked around at how to fix it and come up at a bit of a loss, though. We do a 302 (temporary) redirect from /random to a post. Changing it to use other redirect methods doesn't make a difference, nor does adding an intermediary redirect with a canonical random URL.

The problem comes up in mobile safari and mobile firefox, but not in mobile chrome.

At the moment, I'm running out of obvious things to try and thought I'd open the problem up for discussion and suggestions.
posted by frimble (staff) at 2:38 AM on October 4, 2018 [1 favorite]


I should add that, if I add a parameter to the /random URL, it then works as expected (though not if I redirect from /random to an URL with a parameter), so that's a potential solution, albeit one that makes the URLs uglier. That makes me feel that the root problem is that Safari is interpreting the situation at any given point as "I am at /random", and that because it's going from /random to /random, it interprets this as being at the same spot with different content.
posted by frimble (staff) at 3:06 AM on October 4, 2018


I have experienced the phenomenon of hitting the "back" button to back out of a post, only to find myself viewing an older version of the front page rather than the one I had previously been viewing. This only seems to happen on iOS, and I have assumed it had something to do with caching.
posted by slkinsey at 11:45 AM on October 4, 2018


Safari has always been over-aggressive about caching, in my experience.
posted by Johnny Wallflower at 8:30 PM on October 4, 2018


I've fixed that now – the back button should now work for random posts over all subsites.

Specifically, the page will normally use the /random URL. If you just clicked "Random", then the URL gets a random value appended to it (e.g. /random?i=123). The random value is then discarded, serving only to tell Safari that this is a different site than before, and you carry on to the new random page with a new random value as normal.

There's a chance that the same random value gets generated twice, but in this case, I'm inclined to say that it's small enough and the problems caused are trivial enough that I'm not going to lose sleep over making the random value truly unique.
posted by frimble (staff) at 2:17 AM on October 5, 2018 [2 favorites]


Because falling down rabbit holes is a thing I do, I decided to check what "small enough" even is. For a single random walk through 1000 pages on the same subsite, the chance of two of them being considered the same by Safari is now approximately 0.023%.

You'd need to walk 55000 pages in order to get to 50-50 odds of two of them being considered the same, and 250000 before the odds are essentially 100%.

So the value is not all that unique, but good enough for this.
posted by frimble (staff) at 2:52 AM on October 5, 2018 [4 favorites]


I like how you completely frimbled out on this. Very cool!
posted by Too-Ticky at 4:57 AM on October 5, 2018 [1 favorite]


Just as a data point: I'm on my iPad. Just clicked into a post from the front page. Read the thread a bit. Hit the back button. Returned to a view of the front page that started with October 3. Had to reload the page to get the current interation.
posted by slkinsey at 5:00 AM on October 5, 2018


Just clicked into a post from the front page. Read the thread a bit. Hit the back button. Returned to a view of the front page that started with October 3. Had to reload the page to get the current interation.

That's Safari caching aggressively and a separate issue. MetaFilter already specifies that live threads and site front pages shouldn't be cached, so I'm going to test out a (particularly daft) suggestion from the WebKit docs to disable the Back/Forward cache on pages that are subject to change often. I would have preferred a way to hint to the browser that a page has changed when, e.g. you click '15 new comments', but that doesn't seem to be an available option, so I'll see if a) I can disable that cache sometimes and b) if doing so breaks all the things.
posted by frimble (staff) at 7:17 AM on October 5, 2018 [1 favorite]


I usually go to a single category, and hit ‘random’ from there. It always took me to a random post in the same category. This morning it stopped doing that and now when I click on random, say in the human relations category, instead of taking me to another human relations post, it takes me to work&money, computers, travel, etc. Is that intentional?
posted by MountainDaisy at 12:08 PM on October 5, 2018


That's unintentional. I'll take a look at what's up there.
posted by frimble (staff) at 12:12 PM on October 5, 2018 [2 favorites]


MY HERO!!!!
posted by Weeping_angel at 12:27 PM on October 5, 2018


Pony-bug? Bug-Pony?

That would be a Pug, which is too cute. Or a Bony, which is too... ugh.
posted by Grangousier at 1:42 PM on October 5, 2018 [1 favorite]


Or a Bony, which is too... ugh.

Rude.
posted by curious nu at 8:33 PM on October 5, 2018 [4 favorites]


I usually go to a single category, and hit ‘random’ from there. It always took me to a random post in the same category. This morning it stopped doing that and now when I click on random, say in the human relations category, instead of taking me to another human relations post, it takes me to work&money, computers, travel, etc. Is that intentional?

Sorry about that. It's now fixed.
posted by frimble (staff) at 10:03 PM on October 6, 2018 [2 favorites]


Thank you. I can breathe again!
posted by MountainDaisy at 2:22 PM on October 7, 2018


« Older 145: I Don't Own A Cellphone!   |   It's Inktober, let's make art and stuff! Newer »

You are not logged in, either login or create an account to post comments