you know it's going to kill me in the basement later
Streamed
Tag pagination bug with query strings versus path segments.
Domain page loading failures for domains containing dots.
Action Pack page caching treating .com as a file extension instead of appending .html; monkeypatching; load ooks.
New /banned_ips page for transparency of IP bans.
scratch
topics
PRs - none
issues
replies in wrong place https://github.com/lobsters/lobsters/issues/1692
can't load /domains/thephd.dev https://github.com/lobsters/lobsters/issues/1825
https://binarysolo.blog/applying-monkey-patches-in-rails/
transparency on IP bans
meta thread on slop
title
you know it's going to kill me in the basement later
post-stream
https://www.haikuchronicles.com/podcasts/2009/e9-the-definition
Transcripts are generated with whisperx, so they mistranscribe basically every username and technical term. They're OK but not great, advice appreciated.
Recording
01:46pushcx Welcome to Lobsters office hours! Ask questions anytime.
Welcome to Lobster's Office Hours.
Welcome to Lobster's Office Hours.
All right.
So howdy.
This is Lobster's on the screen.
I'm Peter.
It is cold in Chicago this week.
Wonderful, like, balmy three or so Fahrenheit, which is a little rough.
02:24graefchen Heya limesHi
So you may hear me knocking around, finishing my little bit of preparing some hot tea here.
Because it's cold inside, too.
Hey, Grave.
...55So yeah, Lobsters is this site up on the screen. It is a forum for discussing computing.
03:07You know, I saw this story about Top Gun's carrier landing exposed, and I actually thought it was going to be
was a whole thing when a a recent movie a top gun movie came out i don't know last year or the year before where they were like oh we filmed all of it it's not cg and it's like the weirdest lie and i kept seeing youtube recommend videos that were about how that was bs and i thought i was going to have to be the no fun police and remove one of those and this one is actually about reverse engineering a
Nintendo game.
So that's kind of fun.
And entirely topical.
Yeah, so topics.
graefchen I also thought it was about the Movie first. limesGiggle
That's a misspaste.
04:15Yeah, you know, I'm not surprised there was a movie or a video game when the original Top Gun came out.
It was a cultural phenomenon of a movie, but...
graefchen It seems like your voice cuts in and out all the time. limesNoted
But that's Batman.
It's interesting that there are still so many folks playing with those old consoles and old games.
Anyways, if you're old enough to remember NES games, check out UFO50.
I will not be streaming.
I'll be playing video games.
It's a pretty wonderful level letter to the NES.
Oh no!
Now that's... Alright, my voice should be...
There we go.
My voice should be fine now.
Sorry about that.
It's the darn workaround, and I was running late, so I forgot to run through my usual checklist.
graefchen Now it is indeed better. limesNoted
So my topics are transparency on IP bans.
Yeah, thank you for catching it.
I appreciate it.
And then anything in the issues, anything in the PRs, and the meta thread on slots.
Yeah.
Let's do PRs first, though.
I don't know that there's much activity, but I'd like to start there.
06:03So when I'm not taking questions and we're not commencing about the site or Rails or other things,
...16work on the site.
And what it looks like is reviewing PRS, which have not had any activity since last stream, unfortunately.
And then I also review issues, which Yeah, so this is the issue I want to work on.
So I'll share this link for anybody who wants the sneak peek.
pushcx https://github.com/lobsters/lob…
There's something
Weird with my clipboard, even by Linux standards.
Can I?
Yeah, middle.
Selecting and doing middle paste is not working.
Huh.
Well, that's only going to mess me up 5000 times to have 25 years of muscle memory disrupted.
I noticed it earlier today.
07:18yeah so let's take a look at some of these replies from comment view I don't know what this one is on promotion yeah so this one about 1814 about slow page loads is where I've been putting most of the notes around
...46to performance work, and that's been quiet for a few days now.
...54pushcx https://vulpinecitrus.info/blog…
The one thing that was really interesting was Technomancy, who has contributed a bunch on this puzzle, mentioned this link in the Lobster's chat room that is
someone who runs a git forge and i don't remember which one but they go into all of the detail of getting swamped by scrapers and i was skimming this and so much of this is exactly exactly what i was going through for a week to the extent that let's see where were they
08:42Yeah. I was reading this down and I saw this one 1764 7034 IP and I was like, Oh, I know that IP. I've been that IP. And I did not see this next one. I don't recognize data for seo.com. But that's, that's pretty funny. And So as I was reading it, not only did I recognize the behaviors of what they described, but, like, some of these ASNs and, what was that one? HostMagic? HostLayer? What was their name?
09:38HostMagic? There was HostSomebody. Host Royale. That's what I was thinking of. This one was obnoxious. I recognized this AS number without seeing the name because 20, 30, 20 is like a, you know, that's a pretty easy number to remember. And Just all of these. All of these are folks that hit us. So I linked this because that was great.
10:17They're also... They put a lot of time into writing up that experience report and what they tried and what didn't work and sharing their configs. So... That was pretty great post I definitely did not put in time to doing that kind of stuff the most I did was some exasperated tweets. So this is an interesting. surprising promotion of old.
...49yeah this isn't a bug.
11:02Let's go find that app, models, story, active. Come here. We'll grab this. We'll grab the permalink. It is so nice to be able to explain the site and just, you know, like all of the users are programmers, so I can just be like, here's a link to the source. It's just nice for transparency and for saving some explanation.
...42This is, I could do the classic feature, not a bug formulation.
...54Yeah.
12:21Where's this? This one is actually invalid. Sorry to say. I don't have a better verb for that adjective.
13:01Could we?
Yeah, so this stories with active discussions.
graefchen But it is definitively a feature that looks like a bug. I would have assumed the same. limesNodders
That is not good help text.
...33So let's fix that. In which case, come here. Let's take this off and put design on.
14:14Is there an active.html? Yeah, OK.
...22So how do we want to say that?
...44stories sort of i want to use the word active but that's not great so what do we want to say we want to say it's stories we've got to have that now we want to say the word active we want to say sorted by last comment so if we say stories with active discussions sorted by last just say it like that is that clear stories with what if we turn it around story sorted by to surface i hate surface as a verb
15:47You know, if you hate a word as a verb, Peter, you have a thesaurus in arm's reach.
Let's look up surface as a verb.
So this is some of the dead air of the stream as Peter looking things up, and this thesaurus is pretty common.
Q, S, T, S words.
is promote is kind of the sense i mean this may not have surface as jargon pq surface space top experience shallowness well shallowness is certainly my gripe with that ah here we go show arrive emerge manifest oneself be manifest be revealed
Be Revealed is not bad.
Let's look at 350, 1.8.
I should make a little OBS card for Thesaurus.
Here, I can at least put up the Thesaurus.
pushcx https://bookshop.org/p/books/ro…
Oh, come on.
I can't mouse because the big-ass thesaurus is in the way on my desk.
All right, so 351.8.
Disclosure.
No, this is... No, this all has...
It's funny how making something known...
So section 351 is disclosure.
Making something known.
But, like,
Almost everything has a real negative connotation.
Like.
Leak.
Giveaway.
Blabbing.
Blabbering.
Tattling.
States evidence.
Like.
That's.
That is not the mood we are in.
I want more.
Be revealed.
Become known.
Surface.
Come to light.
Appear.
Manifest.
Transpire.
Leak out.
Get out.
Come out.
Yeah.
See.
It's still in this very.
come home to roost come out in the wash break forth this very idea of like everything secret is in some way nefarious there's somebody's got a philosophy or a psychology paper on why that is all right so 31.4 let's try show
18:42So one of the reasons I recommend getting an actual print thesaurus is that kind of serendipity of seeing words in the neighborhood of what you're seeing. Be revealed, be evident, be noticeable, be obvious.
19:03Emerge, come into view, materialize.
No, no, no.
These are all, again, these are not great.
Let's try promote.
Or encourage?
Nourish?
Nourish is kind of the neighborhood.
Because the point of it is, you know, if you see like an HN or a Reddit story and it's three days old, there is absolutely no value.
There is rounds to zero value in writing a comment.
It is not going to be seen much.
And...
We move a little bit slower because we get a lot fewer links and we have a lot fewer comments.
And then also, you know, the first link next to the logo is that.
All right, so we got feed, nurture, keep alive, encourage.
Ooh, I like encourage.
Let's try it.
graefchen Thesaurus also reminds me of how some Dictionary's had the wrong definition of Haiku and the American Haiku Society had some very hard time getting that changed in some Dictionary. limesNoted
Here we go.
Hearten.
Embolden.
Hat on the back.
Clap on the back.
Stroke.
Invite.
Ask for a bet.
Keep in countenance.
Foster.
Foster's a good word here.
Move 1, 2, influence, slay, dispose, carry, bring, lead, lure, tempt.
Tempt?
That's a weird one.
Determine, decide, procure.
Foster is good.
Nurture, nourish, feed.
21:00Yeah.
All right, let's say Foster.
Oh, no.
What dictionary... Or, not what dictionary.
What was the wrong definition of haiku?
Oh, God, I can't type.
You know, there was...
pushcx https://theonion.com/japanese-m…
great article ah there we go i found it off stream here there's a great article in the onion the other day here japanese monk racks brain for haiku that will knock them on their asses buddhist monastic desperately searches for three impressive lines and these do not start with a
graefchen 3 lines, 5-7-5 verbs probably. limesLurk I can not remember more. limesD
don't include a reference to nature or the seasons but they get into it in the actual article anyways this is some fun writing i guess it's just middle click that's broken because i can't middle click to close a tab that's
It's going to be real fun to debug.
22:32All right.
23:02So that's a little better. And then let's just go ahead and kick that in. And did I not fetch from remote? Did not fetch from remote. I am out of sync. Where did I merge? Oh yeah, this one. This was on the last stream I had merged on, I guess. There was a funny comment on this one. This link to the top.
...49graefchen not verbs ... limesHeck I meant syllables limesHeck
You know, I must not have done this on stream.
I must have done this right after.
Or maybe I saw this on this.
I saw this and I merged it.
Let's see.
So December 11, 1025.
December 11, 525.
So I saw it just when it was a couple hours old.
Yeah, I followed what you meant by syllables.
And Felix left an amused comment that they were reading their mail and could not find the link at the bottom because their PR was already merged.
24:35there we go you know i keep being so happy with jujitsu for those kinds of like i get clear error messages and i understand what these things are and then this hint is like hey here's the specific revisions that you have these and then you can see everything and it's just
It's so nice, and I feel safe moving commits around.
I'm not worried I'm going to accidentally lose my commit or get weird conflicts or...
There we go.
graefchen Heard about it from this old Podcast, if you are interested: https://www.haikuchronicles.com… limesLurk
So there's the actual thing and the purpose.
I like that.
Saying the what and the why.
25:36Is it a podcast about haikus?
...47All right, I will have to listen to this off stream. Let me grab this link and put it in my notes.
26:01I cannot imagine doing a stream that is like Peter reacts to things. I know it's a thing people do, but yeesh.
...27graefchen Yes. And this episode is information about the definition. Which I find extreamly interesting. limesSip
chamlis_ PR reaction stream
Alright, if folks would quit texting me, I could stay focused.
...37PR reaction stream.
I mean, that is kind of what this is.
Hey, channel, it's good to see you again.
graefchen Pro PR reaction stream limesGiggle
All right, so there's that.
...56So what do we have here?
chamlis_ hiya!
Okay, so this one, I've seen these because I've labeled them.
27:10Tag view seems broken. So when they load any tag and they go to the bottom and they hit page two, they just get, no, that's not page one again.
...34I thought I reproduced this. So landlock and image.
...44It's caching, though. Oh, it's caching. All right, let's let's fix this. So what's happening is the full page cache doesn't handle query string parameters. So this is if folks happen to load, depending what order pages get loaded in and the cache gets filled, it's going to be wrong. So how do I want to do this? Because I would like to cache these tag pages.
29:14And it's supposed to be slash page slash whatever. Huh. Okay. So we've got two things happening. Number one, the pagination links are getting generated wrong. Yeah. So I just go to the tag page. that's just wrong it should be this style but then second the multi-tag isn't going to either of these hang on let me see there isn't a tagged method i think so a while ago like years ago i split up the single tag and the multi-tag into two different routes because the code paths were different enough that it was painful
30:34I wonder if I broke pagination that long ago. So this should be multi-tag, apparently. If we bring this up here, this one should be single tag. I should have this constraint. Kind of hate putting time into the pagination system instead of ripping it out. But this is a weird couple of bugs, because everything with caching is bugs. So let's write some specs.
31:35Well, first let's see that route. I shouldn't close the old one so I could compare. Now that's what I want to see. Good.
32:22So here's the pagination code.
...38It must not be setting this. What is this root path variable?
...58whether you're on the home page or not. There's a better way to do that, and I don't want to fix that.
33:13Not right now.
...19So this actually might fix the generation, just fixing these two routes.
...32So we already have a tag. So it should write a single tag page two.
...54And then
34:06So those should be fine with the code as it is now. Broken as it was, I'll back it up. And then I'll check generating in a second. Yeah.
...36Recognized options. I think this is the page link has to be first. Otherwise things are getting crammed in the wrong place. Let's double check if that's all that is. No. Let's actually read the message and think about it then. That's the worst. Recognized options.
35:09So why didn't you recognize this route?
...24Or multi?
...35Oh, no, I got it. It's because I didn't update the expectation. I didn't say that, yes, you should also successfully extract the page variable. So that's fine. Good.
36:09OK, so one of these is correct, and then this one is grabbing too much. So all right, let's change this to be the string 2. It's fine. The controller can sort that out. Good. And now this one, which test is failing? 11.
...45It's the constraints. By overriding this constraint, we're accidentally capturing everything to the end of the URL.
37:06This is the same thing about a string.
OK.
So this should be green.
That's better.
chamlis_ there's a typo, missing n in idetifier I spy
Let's start the Rails server locally.
chamlis_ in config/routes.rb
Missing N in identifier.
Where did I do that?
Identi... Inconfig routes.
I-D-E... Oh, you're right.
Good eye.
...52How did that... That's probably quietly been broken for a while. Yeah, because the other side of it doesn't match. All right. Well, thanks for catching that. All right.
38:21Let's see if this wants to generate good pagination now. Yes. Okay. So that's fixed. And it'll be fixed in the caching because now it shows up in the URL instead of the query string. All right. So let's just go ahead and...
40:20That's an easy one to fix. So what's this one? Oh, yeah, this one. This one, I don't know what this is. This is an older bug that seems to have come back. So, pause.
41:55pushcx https://github.com/lobsters/lob…
All right, so then this one... Oh, now it wants to load.
I reproduced this one, I think, this morning.
I'll share the link.
And I was really puzzled because I pulled up our bug tracker and I did not see a 500.
42:38And indeed, I'm looking at it right now and not seeing a 500.
...59chamlis_ was it that typo?
chamlis_ I was peeking around a terminal window before but I think that was in the domain section?
No, because I still have it here on scroll back that was on a origin.
So if it includes a
identifier, that's one of the origin URLs, right?
Let's double check.
43:42Yeah, I also, that was a pagination one that I fixed. Yeah, so that was an origin. route that got fixed okay so it's not that all right well there is a distinctive id there so let me go look at the prod logs real quick
44:55chamlis_ hmm
And the logs do, the Rails logs do show that it threw a 500 on some of these.
That's weird.
Exception message is a directory.
45:19Oh, I get it. I get it. So the way The way the caching works is it takes your URL and it constructs a file name out of it.
...55So what must have happened is something caused a page under the phd.dev to be cached under that URL meaning. And then when we went to serve it, so let me, the thing I'm seeing in the log is
46:33It's me fighting my middle .
...48So as soon as I released, it would have cleared this cached domain.
47:09So I wonder if it...
...29I bet it's pagination. That would make a URL under it, right? Yeah. So it tried to serve... So try files... No, it's the caching. Filling the cache was throwing the exception. I get it. So someone loaded page 2 for this domain, which created... Well... So it created public cache domains, the phd.dev slash page slash two. And this was an HTML file. And then later, someone tried to load this and it wanted to write this file name. And when it went to write this file name, it threw this exception because it was trying to open the file for write, and it said, nope, it's a directory. Okay, so this, instead of saying, you know, it's a directory, I should just create an index.html in that directory and be happy. So this feels like a bug in action pack page caching. And that must also be why, because that's a rack middleware, that must also be why it didn't show up in our log. So I put the exception notifier first.
49:49graefchen I first was extreamly confused, but that explanation really made it clear. limesNoted
That's not.
...57Nogweii good afternoon everyone!
Where is it configured?
50:07Oh, hey, Nagwe.
...13graefchen good afternoon Nogweii
I don't think it has much configuration, does it?
So it's gem file, action pack, page caching, which has come up here a bunch.
...31Yeah, you know, I was getting nervous about this. last touched was two years ago and oh yeah they closed it to issues huh why don't i see the usual control to go see closed
51:08There have been zero pull requests since it was here. I guess so.
...47You know, that's funny. That's two bugs in a row where it's been related to the full page caching. And it's probably this bug too, or no, it's not this one too. It's, I was talking about replacing our file system based cache with a SQLite stored cache and this exact thing of mapping a URL to a file system name is the kind of iffy transformation that's a problem right here.
52:48All right, so I got a trace back, actually. So let's bring that up.
53:10The default Rails logging still does log some things. It's weird. It should have been logged because it's inside the Sentry. But I feel like a character in a horror movie where I'm like, oh, I'm not going to worry about that. But then, you know, it's going to kill me in the basement later if I don't know why Sentry didn't log this.
...49See, I almost wonder if it was a race. Except that it was repeatable. Yeah, so it's not erased because I was able to, many minutes after the bug was filed, reproduce it. All right, so let's go look at the...
54:48One, two, four. One, two, four pages. Let's nest.
55:12Yes, this is the bug. tried to make the directories up to its desired path and then right to that path is this literally what the last commit is about because this thing says remove deleting slash
...49And this is the same file, 149.
...57Because that link didn't end with a trailing slash.
56:09And they changed the behavior of how trailing slash works. So if the path is empty or The path ends with any number of trailing slashes. Make the name index.
...28Otherwise, remove the trailing slashes. If the name is empty, we can add the extension. So there's where the HTML comes from. Because there wasn't a trailing slash, it thought, ah, I will make a file by this name rather than index.html.
57:24How does this work for anything? Like the root I get, but the rest of them, the root is the only thing that's getting cast as index.html, isn't it? Because we don't use trailing slashes on...
...57if we have any config around trailing slashes.
58:27Yeah, that's 10 million things.
59:00I don't know how to fix this. I'm taking logs.
...19We're going to just struggle today.
01:00:14I mean, I could monkey patch this to put in if, like, I don't remember what the method is. It's something like if file.directory.
...58which really simplifies down too.
01:01:30Would rather not monkey patch a two-year-old dependency, though.
...42Or a two-year unmaintained dependency. At that point, it's you broke it, you bought it, right? Hmm.
01:02:08Why hasn't this happened before? Really, we made it 13 years without seeing this one? Well, without seeing it reported. There's a question. I showed that exception. Do we have other instances of that exception in the log? Err, no, colon, colon, EIS dir. that do not mention this domain? Yes. Yes, we do. Here, let's bring that on. This has been happening a lot.
...58It's just since I enabled the domains view. There's something about it that it doesn't like. OK. Because if this was like a one in a million kind of fluke that some race condition created it wrong, all right, you know, punt on it. Give it another 13 years. What is it about domain?
01:04:00It's just that it has pagination, isn't it? But this fails for no, I don't see him in the log. I was going to say, does it fail for tag pages, but no.
...20And those were wrong too. Can we make it fail for tag pages? Let's say FreeBSD page 2, page 1. Of course, page 1 is probably already cached.
01:05:15jangomandalorian ππΌ
Hey, Django.
...30See, that's interesting. It made it a directory.
...45But it's just not caching anything at all.
01:06:04OK, so.
...22So now it didn't error.
...32So I picked YouTube because I literally see it in that log that I had on prod.
...55So now we've got another bug. It just didn't get cached. Unless, you know, I loaded those two exactly before the page cache was cleared.
01:07:16Oh, there's the bug. And that was interesting because it had a trailing slash on it.
...32So it's failing to cache pages after one. And if you load one of those before the root cache, so if I arm-r domains youtube.com, now we filled the cache correctly. Yeah, see, that's a file instead of being blue like a directory. So if I go to Page two, now this one fails because youtube.com is a file and it can't make a directory.
01:08:19Yes, and so that tapping was just me off screen. Here's the, it's the opposite error.
...55So why am I not seeing it for? Let's throw that away. Oh, so the expiring job came along, got it. So now I can load that. OK, it does get created. Now this one won't load. And the job that's expiring in the cache must be very hungry.
01:09:39Yeah, it's not in Cron anymore. It's expire page cache. That's only supposed to take files that are older than a few minutes. And that's clearly a file that was like 30 seconds old.
01:10:16Is it only failing for domains because they have a dot and action pack?
graefchen I must say, that this seems like a very nasty bug. Even if I assume, that the fix would be trivial. limesHmm
Page caching is like, oh, you have an extension, so I'm not going to put dot HTML on the end.
...55I get so many files.
01:11:11Because it's not capital T. See that? We haven't seen this bug before. because it sticks a .html on the end, except, except, what was that about a default extension?
...44Extension is nil if perform caching.
...53default static extension dot type symbol. What is a type symbol?
01:12:12If type, if you respond to a media type,
...34I would like to see the smoking gun. I really suspect it's going, ah, you're asking me to cache a path that has a dot in it.
01:13:05Unnormalized path. What is cache file?
...20There it is.
...25File dot ext name. So if I say. youget.com. Okay, so there's the bug.
01:14:01Yeah, great. This one is no fun to debug. It's clearly been This whole thing about mapping URLs to file system paths is just... It's clever, but it's wrong, conceptually, just because they both have slashes. And in the past, for a very long time, web URLs looked like the way they do with slashes in them, because on the original web servers, this was a file path. But now that the two are not the same thing, trying to port back to a file name path is what's getting us.
01:15:20So I think what I really want is for this to be consistent. Yeah, I guess they did it this way so that if you serve example.jpg which could come out of your rails app you want to save that on disk as example.jpg so that when the web server pulls the file off disk it looks up in its little mime table ah it ends dot jpg let me set the content type header
01:16:26So it's interesting because I'm passing in these pieces, but I can't bypass this logic and pass in like a... It's got this distinction between a path and a name, which is nice.
01:17:04I am getting another text and I may have to go run help my spouse. Yeah.
...20Oh, I see.
01:18:06So we've got to sneak in the middle here.
...34Calls cache path.
...41yeah see all this stuff is bolted together there's no place, I can step in and like it's saying well if you don't give me a path, I will figure out where to pass it. So.
01:19:58So my two options are. to monkey patch cache file. In which case I have to assume that. We're only ever caching HTML, which is correct for us.
01:20:20Or I have to override cache path. Which. despite its name, is all about normalizing, which I'm going to guess means whether it's an absolute path or not. Yeah, this is kind of an odd method. It's like you are producing an unnormalized path, so that you can normalize it. And then this returns nil. Hmm.
01:21:52We had a monkey patch hanging around somewhere. Maybe I deleted it.
01:22:08I guess I did. I think the code to normalize URLs was monkey patched into string.
...58Thank you.
01:25:48Thank you.
01:28:27You know, I wonder if they would even take a fix. They have pull requests open, but you can't really... GitHub doesn't actually let you disable the pull request tab. Does it say something in the readme?
...59no status well they still have a contributing section oh wait this is just some random person's fork why did i land on that instead of the actual
01:29:33Okay, so this one does have issues and PR is enabled and seems to be active.
01:30:08But it looks like it's not so active that they're responding to issues, even ones that are over a year old. What's closed? Nothing has been closed in years? Here, hold on. Just give me everything and switch to the sort you should be using.
...37Yeah, so it looks like the last time an issue was touched was just about three years ago. And they merged a PR four years ago. Huh.
01:31:24Oh no, it's just sitting open. I misread and I thought it was merged. Okay. Sort. Recently updated. Show me everybody.
01:32:54What am I in here?
01:33:20Actually, you know what? I'm going to do this short style, because this will blow up if it's not loaded.
...31Page cache? Page cache.
01:34:01It's a cache file that I want to hit. What did you? Oh, it's a second Vim instance. Let's just stick around with clipboards forever. That's a whole programming stream right there. There we go.
...42All right, so if that's where we're going to go, tname youtube.com. OK, it does include the dot.
01:35:20That looks pretty good. Does the real server start? No. So that's probably the exact problem I want. An initialized action controller caching pages must not be loaded yet.
...56Or it is action patch slash page caching. Everything is just mapping. Everything is just mapping strings between slightly different formats. Next bug is going to be snake case or something. Still uninitialized.
01:36:44So it's over here. Step out. Come here. Undo. Step out.
...59Page cache. Pages. Action controller caching.
01:37:18Pages. Oh, it's not a module. It's a class. Is that my bug? That is not my bug.
...50Two bucks.
01:38:22Caching pages.
...28OK, so this is the name. Did I typo?
...47No, I did not. All right, so then this is some kind of awful load order bug, even though I loaded the thing.
01:39:09One of my least favorite things about monkey patching in Rails is knowing whether everything is loaded so that you can do it. Hmm.
01:40:17OK. That was it, I guess.
...26Was it just the one thing? Do I still need the require? I do not need the require, and I would rather not have it.
01:41:04How do we feel about this? Can I test this locally? I think I can. Enable the foot gun.
...25Start the Rails server.
...35OK, there's nothing in the cache directory. Localhost 3000, domains, youtube.com, page 2.
...47Nothing was cached.
...58And then just youtube.com. Well, there's the bug.
01:42:09ghost_user_1984 Are we back on the caching?
Where did it cache?
Just directly into public domain.
So there's... We never get off caching, Hunter.
pushcx https://github.com/lobsters/lob…
So this is a different bug.
This one's not performance related.
I mean, it's enabled for performance, but it revealed a bug in action pack age caching that's been there for a few years, but
It's unmaintained.
So I'm attempting to fix it with a monkey patch.
...58And I'm guessing these got loaded out of order. Oh, maybe I do need that require. here to make sure the class is loaded. Let's test this one more time real quick.
01:43:27Same bug.
...34And I'm going to bet our function does not print monkey patch in here. Did not. So the monkey patch didn't happen.
01:44:01So Hunter, the real short version is when we tell it to cache a page, it looks and says, oh, do you have an extension?
If you do, I'll leave it alone.
So, you know, the web server can see that.
So if I had cached youtube.json, it would be saved as youtube.json.
If I cached slash YouTube, it would say, ah, you're caching HTML.
Let me append dot HTML.
ghost_user_1984 are you getting overridden by something else?
If I pass youtube.com, it goes, aha, you are caching a com file, whatever the heck that, I mean, I don't think the server has a mime type for
early DOS executables.
Maybe it does.
ghost_user_1984 ahh thatβs a fun one
That kind of stuff accretes and never goes away.
Well, I am trying actually to monkey patch something else.
So in action controller caching pages, in the class page cache, it has this method cache file that tries to figure out from the path you gave me,
What extension do I want to use?
ghost_user_1984 it probably does because file would be installed as part of Ubuntuβs base
Maybe because, what if I just said plus HTML?
So let's, yeah.
You know I didn't see the I still didn't see the puts so, even though this is.
Also correct, even if extension is empty and we know extension is html already because everything else works like index.
So i'm going to load this but it's not going to work any better.
nope.
01:46:26It's not nest vims.
...43All right, so the top is the gem source, caching, pages, page cache. But you know what, if I changed to this style, I wouldn't be getting the error that page cache isn't defined yet, right? So wait.
01:47:31Let's look in here. Really? We're in some weird fucking insert mode where I'm going to override everything.
01:48:17Yeah, see, it's not defined. I was fibbed too. So even though I've required it,
...56Let's see which one of you fails first.
01:49:07So we get action controller, we get action controller caching, but not pages. So even though I asked for the gem to be loaded, the gem was not loaded.
...46Where do I want a monkey patch? A gem.
01:50:01Yeah, I see you did it in an initializer. And then you get a different exception. If you try and reopen a class, it's the same as declaring. Yeah, well, this is my error.
...29But my real error is that it's happening before the monkey patch is happening. Yeah, see, if I stick it in there in initializer, the gem's still not loaded.
01:51:30This is going to be so annoying. Is the gem only loaded in production? No. It is not in a production-only group.
...54So it should be getting loaded. And indeed, I require it. Why doesn't that require throw and error?
01:52:39Yeah, we used to have a core extensions directory, something like that.
...49And these extensions are things that are in the standard library, not a gem. Aha, yes, that is my exact bug. Exact thing I'm sighing about, so good timing. Hook it by OK. Active support on load.
01:53:21Let's see if that hook is mentioned in the gem.
...40no the gem does not have its own but that's promising they put their load so this is why it's not loaded because action controller hasn't loaded yet so if we hook this same thing so if we fight with the clipboard forever or the middle mouse button
01:54:37Let's make sure that's loaded. All right, let's see if that gets us anything.
...48Okay, yes, everything printed. The monkey patch patched, presumably. So now if I reload this, ah-ha-ha, And now if I look at the files, yes, it correctly created a dot HTML on the end. It works. Man, that was... Who knew that reaching into the guts of some other random part of the program could get risky? So now I could probably change this back to, say, this. Actually...
01:55:45No, I can't. Oh, there's an extra end. And now I can load this. And I can go to page two after. And everything got created correctly. Let's disable the foot gun. Review. Oh, yeah. This part can go back. So we got to test the smaller monkey patch, the single line.
01:56:55Good.
01:57:05So here's the big diff, big solution. Cool.
...17A typo in there.
...54Yeah, that's as good as that gets.
01:58:28Still don't like that Sentry didn't log this bug in production. But I don't know how to debug that one.
01:59:55Alright, fun bug.
Alright, so we're right about
pushcx This is Lobsters office hours, ask questions about the site anytime in chat!
hours and i usually go about three so this is a good time to say that this is officer's office hours to ask questions this side anytime there we go i think i knew that about these i think the the monkey patches we used to have were on core classes
02:00:50Let's throw that in notes.
02:01:02Wasn't there another issue I just touched here? Oh, yeah. This one. Let's just mention we touched it.
...29graefchen Monkey patching is IMO an very interesting concept. limesLurk
so in the very slow page loads there have been a whole lot of fixes and yeah well i mean it's one of those things you can do with a very dynamic language means you will always have slower performance because everything has to be one more level of
lookup in your interpreter but there are just a couple of those kind of bugs where i know what else am i going to do fork the whole library and change one line of code if
02:02:26If this was written in a more functional style where page and path and URL were types that were constructed and everything acted on them, it would be a little easier to get in the middle. Instead, everything is a string and the boundaries of those functions are kind of in funny places as it evolved over time.
02:03:13pushcx https://github.com/lobsters/lob…
so i guess i posted it in the anubis issue but i wrote about how because of the really aggressive scrapers a lot of which were out of alibaba tencent and huawei asns
I wrote a terrible little shell script to grab the list of them, their IP ranges, from Anubis, pull out the IPs, and call drop table.
Or add a drop rule to the pre-routing table of IP tables.
Not call drop table.
I'm crossing over networking and SQL databases.
02:04:18So I also configured, what is it called, like net persistent or something?
graefchen Getting good ol' Bobby involved is sometimes not so good. limesGiggle
I forget the name of it, but it's a Ubuntu package for saving these files, these IP table rules, because otherwise, usefully, they get cleared on reboot.
...53Yeah. So here's an example of what these look like.
02:05:14So what I want to do is real quick, hack up a script that grabs these files I gotta make them readable. I gotta make them readable in some... reliable way.
...59Hold on, cat needs attention. Yeah, buddy. Cat would really like to play fetch. Right now. So he's bringing me his toy. Yeah, big sir. Does this help right now? You didn't want to play earlier when I wanted to tire you out before the stream. But now... All right, one sec. Come on. A little bit. Yeah. Don't slap at me. Monster.
02:07:03It's like having a toddler that never grows up sometimes. Alright, so...
...43OK. So we'll do that. And then I guess I will manually do it on prod.
02:08:01Just because I don't want to have to do two deploys here. And then what am I trying to say? Oh, this is. a little clunky to develop because locally I'm not going to have a copy of these unless my local machine happens to have those.
...35So let's add a route. Guess to the about controller? I don't know. Moderations? Where should this live on the site?
02:09:04Feels like about.
...12I can already tell I'm going to fight the rails inflector on these things.
...48IP bands or band IPs? Band IPs. That sounds a little nicer.
02:10:29I think we need a helper.
...49That's a reasonable class name. Index. Let's cache this page too. Well, yeah.
02:11:47Extras maybe? I mean, it is an extra thing. Don't love that. I guess it's a fixture. Yeah. Let's make fixtures.
02:13:16chatting in the IRC channel for a second there. Somebody showed up with a bug, and it was a bug I saw in the bug tracker, but I thought, that's a weird one. And yep, it was so weird, they showed up to ask about it.
...41All right, so let's, yeah. I shouldn't have to be root anymore.
02:14:04I'm not gonna commit these whole files. Oh my God, they're megabytes long now. That's surely not gonna cause any pain, right?
...39So I am going to cut these things down. So there's like a couple of these. Go down to a line with a comment on it and we'll keep a couple of these. Then we'll go down to the end and we'll keep.
02:15:03Couple at the end there. Yeah, one at the end. And then same for rules v6. I just wanted to roughly keep a couple of... Do all of these have comments?
...29I guess I was better about v6. All right, let's create a couple that don't then, because that's what I really need. is to protect myself from future oddities and then i'll have to come back and edit these things to add comments for the ones that don't have comments because i sloppily did not add comments for everything as i went and like this comment huawei is not good comment but it allows you to see what is going on i i mean it makes sense if you have read this issue 1781 it doesn't make sense on a page alone so i'm gonna have to improve all those comments on production which is annoying but fine like i can do that in vim in a minute
02:16:5720 seconds to file.join.
02:17:33Almost want to map that.
02:18:17What are we mad about? Unexpected string literal. Did I close one too many parentheses? No.
...54What's my typo? Is it actually up here? No. Open, close, close. Open, open, close, close.
02:19:19What's the dumb bug? Because there's a dumb bug here somewhere.
...45Oh, I bet it's the ands. This one gets me. It's a precedence thing. Yep. All right.
02:20:05So what I want to say, I'm going to throw away that start of the string, don't I?
...21There's a method for everything in Ruby, right? If I want to remove a leading string,
...38I don't want to do a byte thing.
02:21:11Chomp takes it off the end. Delete prefix takes it off the front. How is that different from chomp?
...46It's really not. OK.
02:22:28Definitely not writing a parser for these things.
...38So I don't want to handle commits versus non-commits.
...52I guess I can just do that up in the view layer.
02:23:39Thank you.
02:24:15Let's go with VPNs.
02:25:09is kind of passing an ad hoc data structure around. Wasn't it just griping about types?
...44Let's see how that looks. I know how to work. Yeah. Gotta actually start the We have a server, though.
02:26:25There we go. All right. So some of them get a quote and some of them don't. Let's remove it if it's there.
02:27:10home stretch.
...38You know, if there is nothing in those files, what are we going to get?
...48Probably an error of some kind. Right, so if I said...
02:28:23And if I tried to say... E-A-C-C-E-S.
02:29:35there we go so let's reproduce that did i leave dev caching on no okay just how do you have not been and all right just something odd about the flash there i'm not going to worry about that one all right so how do i want to explain this
02:31:55All right, link. Yeah.
02:32:31Thank you.
02:33:27Let's put this on a ringer C the other day because I was talking about VPNs.
...37Yeah, there we go. So the issue hasn't had a lot of activity, but it comes up in the chat room because people use VPNs and are like, hey, why can't I visit the site?
02:35:16How do I want to put this? Your VPN may be blocked, but... I'm trying to say... If you hang out with a bad crowd, you may get inadvertently blocked.
02:37:34I hate this writing.
...45Did I disable the foot con?
...55Yes. Did I remove this typo? No.
02:38:08Okay. And now the flash is cleared. What's the... This is a Rails thing. Right. Because it's expecting me to redirect or something.
...29What's with the...
...49Loggers have been forced to ban some IPs and ranges to avoid being overloaded by aggressive bots that use thousands of IPs to evade rate limit. We don't try to block VPNs, but if your VPN is also used by obviously abusive bots, it may get blocked. Officers does not use IP bans to block users. All user bans appear in moderation. Let's put that all in the link. I don't like how much of this writing is written in the negative. I try and write things in the positive of we are doing X rather than we're not doing Y. Hmm.
02:40:18soon.
...55It's not avoid, it's to prevent being overloaded by... Yeah, that's a long-ass sentence, but it's not like if I introduce them as a topic.
02:42:20Thank you.
02:43:07Let's show the list of banned IPs. I could just say IPs, right? I don't need to keep saying IPs and ranges.
02:44:03Let's be consistent about block first ban.
...43OK, so there's that and then this all user IP.
02:45:04OK, that's. That seems pretty good. Let's indent again and again and again. Have I run? I have not run the whole sweet bad maintainer. Oh, no, I would say no cookie, but I'm going to go make some cookies, actually, because it's a cold day.
...35Yeah, actually, let me throw on the You know, I said cookie. And now that I say cookie, I've got to turn on that notice. All right. Oh, standard failed. Do not define constants this way within a block. You're mad about the previous commit.
02:46:14I can come back for that.
02:47:27This is not good. I'm expecting to have to touch much, so I'm not actually writing a proper set of tests and everything.
...44What's this number? How are my windows out of order so badly? One thousand two. Oh, that's been hanging around for a minute.
02:48:13Oops, the Anubis one.
...21I saw it. 17 something. 1781.
...47OK, make a new one. And let's see if we can make standard happy. I may just have to disable that one. That was an initializer. Initializer for something about monkey patch. There we go. So don't define in a block. What do you want me to do? I'm going to do the other kind.
02:49:55This long, irritating warning is tracked in their issue tracker, and they meant to rule clue to fix in their release last month, but somehow it didn't get merged down correctly. So it is waiting until I think they're on a monthly cadence.
02:50:17Constant definition in block. All right.
...30Anybody talking about a hook?
...43But that's not what I'm doing. It's also not what I'm doing.
02:51:06Can I find a mention of active support on load?
...21Some random diff.
...35They disabled it when they added their use of onload.
...48Actor record multi-tenant. That's a big popular one. We're trying to become popular.
02:52:04MayaRainer 22 raiders from MayaRainer have joined!
Oh, I thought this was the default one that Basecamp is pitching.
...31MayaRainer raid message
Yeah, they just have it disabled.
Robinspi raid message
I'm just going to... Maya, you picked a...
I mean, howdy and thank you, but you picked a bad time because I'm literally in the last three minutes of my stream.
Robinspi Nice timing
But nice to meet you all.
pushcx https://lobste.rs/
So for context, I maintain this website lobsters.
And I code on stuff on stream because the code base is available.
pushcx https://github.com/lobsters/lob…
So I will share the link.
Robinspi Second time I've seen lobste.rs this week interestingly enough.
There are plenty of bugs and feature requests if folks are developers.
MayaRainer hello, how are you :)
There is absolutely no video game playing happening on this channel.
So if you came here for that, sorry.
Ah, neat, Robin.
All right, so we're going to, I'm just going to disable it here.
Yeah.
02:53:55I ran over my, what do you call it, lint?
02:54:08Constant definition in block.
...22Robinspi Ah fun, there's a post in there complaining about D-Bus, should be fun...
Anyways, it's been a nice stream for you folks who are getting to see the end of it.
Dbus?
Oh, I mean, you know, Robin, it's
Robinspi Oh yes.
There's a comment complaining about everything, because there is no technical decision that is so obviously right for all circumstances that everybody likes it.
Except for my preferred inventing style everybody loves that.
02:55:00Okay, so that. I don't love it, but that satisfies standard rv.
...45I don't know what to say.
02:56:00All right, that fixes the build.
Let's push this all up and deploy.
So Maya, I feel like your raid is kind of wasted because I really am winding down right here.
Robinspi Well you came up as a suggestion by a viewer
Do you want to pick someone else and I will type the raid button and we all can raid into their other person to end the stream?
I almost never think of doing one of those.
Oh, I came up as a suggestion by a viewer.
Well, that's really nice.
...43Yeah. So this was, this was the bulk of the stream was hassling around to monkey patch this thing. There's a whole, what do they call it? The raid browser. How do I do that? I am not like very slick streamer. So this is very much like, yes, there is a slash raid browser command. Can I find someone else? Same category. We're just in software and game development. Can I search for Rails? Find somebody else doing Rails? No, that's searching by username. Filter by tag. There we go. No one else has tagged Rails. How about Ruby on Rails? Or just Ruby? Ruby? Nobody. Maya, what was your channel about?
02:57:50Or Robin, if you can tell me what Maya's channel was about, we can try and find somebody else. Because, I don't know. I'm donezo. After about three hours of streaming, I stopped making sense. What if I search for the tag Chicago? Are there any other Chicago streamers? OK, these are sports. Oh, it turned off the category thing. No, no one else in Chicago. Maybe web? Is there like a web development tag? Nobody found. Okay, here we go. Someone is working on an MMO web LLM. Hey, anybody using. Hmm.
02:58:57All right.
Somebody who is doing react TypeScript and a lecture.
I think that's what it's going to be.
I think I'm following them.
I don't know what that means.
ibcharles bye
cool how do i there's the button bye folks i don't know if the recording's still going but see you thursday take care