if we're measuring our config file in megabytes, we're probably doing something wrong

Streamed

Aggressive crawler from Alibaba ASINs hitting comment shortcode redirects, overwhelming the database. PR #1767 removing Message.has_been_read, cleanup after notifications refactoring. PR #1768 for inbox unread notifications. Organizing feature branches in jujutsu with a comic book crossover. Caching comment shortcode redirects to prevent future bot attacks. How the unmaintained actionpack_page-caching works and potentially updating it to have Caddy serve cached pages from SQLite. Visual bug in link selection caused by nav design and preventing zalgo text. dev:cache footgun.

scratch


topics
  PRs
    remove Message.has_been_read https://github.com/lobsters/lobsters/pull/1767
    inbox unread notifications https://github.com/lobsters/lobsters/pull/17680
  issues
    caches menu is offscreen https://github.com/lobsters/lobsters/issues/1752
    hibp https://github.com/lobsters/lobsters/issues/1478
    focus ring clipped https://github.com/lobsters/lobsters/issues/1766
  organizing feature branches in jujutsu https://flames-of-code.netlify.app/blog/my-jj-workflow/
  can we cache short comment redirects
  anubis
  username change timeout
  story merging UI? https://lobste.rs/c/3ssni6



title
  line of stubbed toe
  if we're measuring our config file in megabytes, we're probably doing something wrong

post-stream
  dev:cache footgun - config page cache to not be public/cache so puma stops serving it in dev
    .gitignore the cache
    must update caddy config
    must update deploy script that clears
    must update whatever expires the prod page cache now
    

Transcripts are generated with whisperx, so they mistranscribe basically every username and technical term. They're OK but not great, advice appreciated.

Recording



02:55Alright, let's get the stream on. There we go. Let's get this all filled in. I don't have any post-stream stuff yet.

03:13So, hello. This is Lobster's Office Hours, and this is what Lobster's looks like. It's a website about programming. And I'm a programmer, and I maintain it. on this stream, ideally so that it doesn't just take over my life. And I was so good this weekend where I fixed an acute problem and I did not go down the rabbit hole of completely setting up Anubis. I had an idea for using a nice blog post I'd seen to set up future branches on Jujutsu, and I did not do that this morning. I put it on the stream to-do list. So occasionally I remember my actual plans. get the timer turned on there we go all right i'll settle down so so on these streams folks are welcome to ask questions at any time

04:30pushcx Ask questions anytime, I'll put them in the topic list if I can't tackle them right away!
And why is this grayed out? 29 spam. What are we doing here? Let's go take a look at that in my browser.

...59Yeah, this

05:11toastyykodes hellos
toastyykodes how are u doing
I mean, there's stuff like the random bolding and the super hype stuff. Hey, toastycoats. I'm good. I think I'm about to yeet some slop, though.

...56What did this look like? So I'm looking at the comments about this guy, and it sounds like the author revised it.

06:31This looks pretty fancy to what I just saw. Oh.

...53toastyykodes i need some advice, i am trying to make a loadbalancer, and honestly want to make it such way that people can use it in prod, can you tell me some points i should keep in mind ?
Yeah, this is fucking slow.

07:15ChaelCodes Hey! New schedule?
And is this full site slop? I mean, that image is obviously slop.

...38Is is it a new schedule? Is it not Monday? Did I fuck up my calendar that bad? No. It's Monday. ChaelCodes Today is Monday - maybe I'm off
I started a minute late because I was on a family call. I started, I don't know, 20 or 30 minutes late, but... Oh, this is slop. It's not A, it's B, and the em dash, and then now it's into the... All right, this is just a slop blog. Yeet.

08:14yeah so i usually stream monday afternoon and thursday morning all right so so anyways slop aside this is lobsters oh i've been busy all morning i didn't see it so let's see where i'm at so today's ChaelCodes So we're adding the "Jackal Girl"?
The stuff on my to-do list is there's these three things that have been hanging out for a minute. And then... Organizing feature branches in Jujutsu and Anubis. graefchen Heya limesHi
Yeah, so that one, I want to try and get the Jujutsu stuff and pass through the PRs and issues first. But on... Well, actually, for about a week, folks have been kind of saying that the site has been running a little slow. And then on Saturday, we got absolutely swamped by a very aggressive crawler. It was maybe 10 or 15 hits a second, which is not a lot, except that we're a small one-VPS blog, and it was... hitting an endpoint that blew through our caching because it was a redirect. And then Katie happened to be in the Lobster's chat room and she was like, oh, these IPs you're mentioning, because they were all from one well one or two asins rather than spread out but it wasn't you know one ip it was hundreds of ips and katie immediately was like oh that's alibaba i recognize those we actually have in anubis a whole bunch of lists of known bad actors that just host these kind of crappy bots and i use ip tables to block those ranges and you know poof the site was fine again but i would rather do a defense in depth kind of thing and not have that problem again so the other thing is can we cache short comment redirects so the endpoint that was getting hit, maybe six months ago, we tweaked these comment permalinks. This was just, I did this as a style thing. So if you look at the URL, it's slash C and then this six character ID for the comment. And if I click it, I will get permalinked to the same thing, but with an anchor tag for the comment on the end. And I did that because short, urls are easier to work with for people in a bunch of ways like posting on blue sky and what i didn't think about when i did that was hitting that short url gets you a 302 redirect in our full page caching so this can be served out of the full page cache and and was because i wasn't logged in here but that redirect vinitkme Hello, Hello!
couldn't be because our caching is very file oriented and it works on disk and so they their spider was hitting every single possible comment url so you know they had already started some spider and seen enough comments that then when they got into collecting all those shortcode links they just hammered the shit out of the site And I say that and I'm like, realistically, it is not a lot of scale to get 10 or 15 hits a second, but for us, for one little web server, yes. And I think we could persuade Caddy to cache those 302s. The only thing I don't want to do is have to add every comment shortcode URL to the caddy config because we have 650,000 comments. So like a table is not a lot of space, but it is if you have to check it into the Git repo as caddy config, that would be a little silly. So we'll see how that goes. Yeah. And I would like to add Anubis in So Katie said that the out of the box is really strict because it's for people who have sites that are like on fire and crashing. And I would prefer to start pretty mild. Well, let's just challenge those that are on your bad IP range list. and then not challenge rando visitors, because the median visitor is totally fine. So we'll see if we can get that config going.

14:03So that's about the plan. And then, of course, since it's office hours, we can jump into anything that folks want to talk about. graefchen I think I once visited a website that needed 10 to 20 seconds to load the Anubis stuff. limesNoted
so let's this one hasn't been touched for two weeks that one hasn't been touched since the last stream and then these two are brand new since i was on the phone so let's take a look these are the notes what do we got message has been read oh i know what this is yeah this is tidying up some refactoring pushcx https://anubis.techaro.lol/
yeah so i have looked a little on saturday at the anubis config and it has a i forget what it called it i will send you the docs if you want to poke around ahead of me but it has like a weight i think it calls the parameter or a difficulty that is i think it's even a What's the proper term for the Richter scale in decibels? ChaelCodes logarithmic?
It's not technically an exponential scale. It starts with a P. One of those multiplicative scales where I think it's logarithmic if it goes down. Polynomial. Polynomial scale is what I'm trying to say. Where every... one that you increment the weight is probably twice or 10 times as hard as the previous step and so i saw in the docs numbers from like 0 to 10 or 12 which tells me it must be doing some kind of at least multiplicative scale all right

16:06So let's take a look at these two pull requests. And I guess run the workflows. Okay, this is one person doing both. I really appreciate that they called this out. This is the goal. All right, let's skim this. And then start the workflow. I'm really just looking to see if there are any changes to the workflow. This looks pretty boring. Fine. Boring in the sense of safe, not boring in the sense of not an interesting fix. graefchen I like the richter scale of -15, xkcd has a nice small YouTube short about that. limesNodders
That's... Hmm. This looks like some kind of local dev thing, but I'm willing to add it. The Richter scale of minus 15. Oh, neat. Yeah, so I saw in the examples of Anubis, I saw stuff around like if the bot has a ridiculous user agent or no user agent, you can increase the weight of the challenge. So Gravechen, it sounds like you visited a site that had a fairly high challenge setting, difficulty setting, whatever that's called. Or maybe you tripped one of their custom rules. So I'm going to go, I guess, in PR order and do the lower numbered one first here. So this is cleanup because we did our whole big notifications. This line can go, too, because this is unused now.

18:14Can I just commit that?

...23Because I'm guessing this is going to be a pretty mechanical, easy to approve thing. That's why I'm jumping in instead of asking the author to do these things.

...50graefchen The scale technically has no upper and lower bound (even if 10 can be assumed to be to max, because if it happends, then there no earth anymore any everything minus is not really bad, except when the cat throws the phone from the dresser limesGiggle )
No, this is not correct.

19:00It's close enough.

...52Yeah, I wonder, why did you pull? I wonder what the maximum computation or maximum difficulty for Anubis is. It's probably like 2 to the 32nd or 2 to the 64th, but I imagine there is also a practical number in there of If every atom of the universe was computing part of the challenge, you would not finish before the heat death of the universe. You know, one of those fun kind of physics Fermi problems.

20:49How does this work? I don't understand this. Am I editing slot code? Like this has got to throw an exception if we have anything that loads the messages. And I think it has a smoke test, right? Yes, for the model. And a controller test. Yeah, that's going to throw exceptions. I think I'm done reviewing this because this is nonsense. It's totally plausibly human nonsense, though.

22:05caffeinewriter Hi folks o/ First time catching one of these.
Ah, howdy, welcome Caffeine Writer. So let's, if I click back to the conversation, probably I see a red build. I, oh, because I committed my suggestion that reset the workflow thing. And there's that familiar bug where the workflow just disappears for a couple seconds. And then what's going on with this one? So this one doesn't lint. All right.

...45That looks fine.

...51Marks the notification and associated message as read.

23:08graefchen I also watched the archive of the least stream to get the context of the computer build like city quote. And I like to disagree so much on that quote. But that mainly because semantics, and I don't want to ruin a nice quote with reality. limesGiggle
This test can get deleted when the other PR

...18That's the bug. graefchen Heya caffeinwriter limesHi
Yeah.

...49Yeah, I mean, it sounds like, you know, if you have something nitpicky to say about semantics, you might be a programmer. If you realize it's not worth saying, you're probably a, you know, staff programmer, principal.

24:54Thank you.

25:28graefchen Or an archaeologist who literally sorts broken wall of tell settlements that were literally build on ruins of the old city. limesGiggle
caffeinewriter Hiya graefchen bogotterWave
I saw a cute tweet, Gravechant, to your anecdote that was something along the lines of, one thing we know about all of the pot shards that we've recovered from the Roman Republic is that they were incredibly clumsy with their pottery. How does that pass? caffeinewriter Gotta say, Lobste.rs has been a very comforting place to keep up with the world of tech.
I don't believe this.

26:07Ah, thanks, I appreciate the kind words. caffeinewriter The only thing more concerning than a failure you can't explain, is a success you can't explain.
graefchen Nah. It's pottery. You just throw away when it's broken. And make new one. It ain't that difficult.
It's just kind of about the one thing.

...30How does it only have one notification? Oh, so this is the Oh, I see, this is the DM model. So when you direct message someone on the site. The way we model that is there are two message records, one for the sender and one for the recipient. Yeah. So that's how that works. All right. I was misremembering the model, I was thinking we had one for some reason but that does save a lot of conditionals with are you the author or the recipient for access control for which fields do you update for how do you order things so that's fine in which case Why was there? When does the notification get created? Do we do it in a background job?

28:20graefchen There is a full hill outside Rome that is just pottery. And there are some many cool pottery finds on old cemeteries. limesSit
backfill the notifications but when do we create them we must use the ah okay so we do it here we create it in the background okay so the ampersand is fine

...52Speaking of code that Herb doesn't like from the last stream. I guess we have to do that, yeah.

29:20Box controller. It's fine.

...31Creates a notification from an already read message. Yeah, that's the backfilling behavior. OK. Actually, this is maybe ready to go.

...57Let me double check 1720 to make sure. sure that I didn't leave any extra work.

30:26Oh, yeah. When was this done? Couple weeks ago, yeah. And then I wrote this a month and change ago, yeah.

31:50All right, so that's done. And then what was the other one? 1768. Is this one unblocked then? Or does it have a merge conflict? Yeah.

32:48Great.

33:22So is Graefchen, is one of the seven hills of Rome just all pottery or is it that there's now eight hills? One of the few facts of my not quite classical education burped up that Rome is founded on seven hills. One of them is called Palatine after the Chicago suburb.

34:00All right, so this one we just commented on. Oh yeah, I saw this bug. graefchen I also have a course in University where we sort daub and it is surprisingly fun. And sometimes you fund cool highlights like wood imprints that are very big or wood imprints from a wood floor.
And then this one hasn't changed.

...25All right. Ah, neat. I've never done any archaeology.

...38graefchen It must be an 8th hill. limesHmm
So this one is a visual bug where when you click on the caches link, if your viewport is just the right width, our little pop-up hangs off screen. The update from the last stream where we looked at this is that someone here pointed out that there is actually an even better set of elements and HTML attributes that we can use for this exact pop-up. So that's pretty great. So I updated... my comment here to cross out that we should use details in summary and say hey let's use the popover api so somebody wants a real small thing to fix i've talked about the pop-up and its transparency styling being i probably called it a bug factory but that one's kind of more a

35:54bug jack in the box where it keeps jumping back up. There's a whole thing with transparency creating another stacking context or not creating another stacking context. And it's one of those things where you edit line 400 of the CSS and then line 900 breaks on certain page loads. And so people never see it. And so it breaks like, I don't know, once a year. Yeah. The other thing is a minor update to this one. So have I been pwned is a neat free website that records passwords that were seen in hacked dumps. And the value of that is people reuse passwords across sites. And we got bit by it this morning, because someone's eight year old account was taken over by I think an Indonesian spammer. They put up two just garbage spam posts i didn't even bother throwing them in google translate and invited themselves another account to you know try and make sure they can keep up with it they're easy enough to clean that stuff out but it prompted some discussion of this in the chat room and i also left a comment saying you know yeah a little reminder of the value of doing this one so Next up. Let's do another another CSS one, because I don't think I haven't read this one yet. Lucas ring clicked.

37:55graefchen I saw that. Was wondering what was up with that. Saw the weird like clicked lobster and it was gone. limesO
Speaking of signs that someone might be a programmer, this is an extreme nitpick. ChaelCodes Oooh. Was it easy to find the new spam accounts because of the invite system?
I have seen this. and I never wanted to get into it.

38:13Yeah. So there were two reasons it was easy to spot. When I pulled up the profile, there is a system of there is a note system that is only visible to mods and mods can leave each other notes like I had a conversation with this person on IRC or I made this call and I'm not super confident with it or it also records things and one of the things it records is if you Let's see, I believe it's up in the controller. In the invites controller, when you click on the link in an invite, they get sent, they get deleted. Where is it?

39:21It must be over in the login controller. Oh, no, I'm sorry. Isn't there a...

...33sign up controller. Thank you. So if you click the link to redeem an invite and you are already logged in, we write a mod note that tattles on you. Because a thing that happens is people send themselves invites and they open ChaelCodes Nifty!
their email and it has the link that says you've been invited click here and they click it and it opens in their default browser and we go aha you are trying to invite yourself the reason it is a note rather than a rule is because it is a pretty regular occurrence that Alice sends her friend Bob an invite And Bob created an account six years ago and never used it and forgot about it. And then Bob clicks the link and he's already logged in. So that's why it's not a like, you know, we instantly nuke Alice from orbit because there's actually a totally reasonable explanation for it that shows up regularly. And so when I looked at the account that had been taken over, the very top mod note was this user sent themselves an invite and immediately attempted to redeem it while already logged in. And I went, okay. And then yes, I clicked over to the invite tree and I saw that they had invited three people years ago and one person, I don't know, six hours before. guess which one was themselves and it actually even had the same email address as the one that they tried to redeem their first attempt to invite themselves under so that was i think i said it in the comment like it's a very easy thing to ban somebody from that but from that kind of behavior of posting non-english spam

42:20And it doesn't matter that I saw it.

...38caffeinewriter The invite tree seems to offer so many benefits. It's definitely something I want to explore if I get to coding something for myself/a small group.
Or actually, no. The header.

...48Yeah, the invite tree. The invite tree is mostly useful for spam filtering. It's why that hassle with the Indonesian spam is the sort of thing, I think that's happened twice in 13 years that we've had an account taken over, or we've had that level of clueless off topic spam where, you know, travel agents in Mumbai or blah, blah, blah, you know, just, the bottom tier garbage link building SEO spam. I think two or maybe three times we have seen it in 13 years. Whereas if we had open signups, I would expect to see it two or three times in each minute. And the difference between those is huge. In terms of how much time lobsters would have to spend writing anti-spam features i mean that's it's not just that it saves us a couple thousand hours of developer time it also saves us on a daily basis probably two or three hours of moderator time deleting spam that made it through whatever automated filters were set up veqqio Hey all!
So the invite system preventing spam is enormous, but then it pays a lot of benefits because it actually adds a little cost to the account where I feel like people are on slightly better behavior because they understand that it's a pain in the butt to get a new account as opposed to, well, I'm going to say something really mean. And if I get banned, I'll just sign up again, which is most software sites, right? Or most social sites.

45:09caffeinewriter Hiya veqqio
ChaelCodes Hey
Does Zalgo have a Wikipedia page?

...17Yes.

46:21caffeinewriter And agreed, it's something that I've also seen in some other sites that aren't _strictly_ social, but it just encourages both better behavior, and a stronger sense of community as well as a side effect. Even if it's not a tree, strictly speaking, since you have to know, or at least talk to someone who's already there.
I wonder if this is the kind of bug that Felipe will take on. He's done a bunch of these front end kind of bugs that are very fiddly.

...45Yeah. And Caffeine, you're kind of pointing in a direction that is also valuable where you get a stronger sense of community because you have a border around it because it takes some time once someone has joined a community to acculturate to use the sociological term to get used to those community norms and oh lobster's comments are not a contest to be the snarkiest person in the world which Other forums sometimes get into that kind of failure mode. And people can read it, but it's like sometimes people leave a moderately snarky comment in their first week or two because they're like, aha, I will be the snarky person that Lobsters has always clearly wanted but somehow has missed. This village is missing. It's idiot. And then I delete the comment and they go, oh, if it doesn't work like that, okay. And then they, you know, settle down and they're a totally normal person for 10 years. pushcx https://en.wikipedia.org/wiki/Z…
caffeinewriter It also staves off the Eternal September problem.
But it's hard to have that kind of culture if you have open invites because if we had instant signup like Reddit or HN, the first time one of those much more popular sites had linked to us, the amount of people who signed up would vastly outnumber our number of active users. And if anybody hasn't seen Zalgo text, very silly thing that i get a kick out of yep yeah i think it does help with eternal september because again it just kind of gives us a speed bump all right so that's all i had to say about this one yeah it's possible that there's a

48:55Yeah, I'm at the limits of my CSS knowledge to know a nicer way to immediately fix that. Maybe we could just move the overflow up to a higher level on the comment. I don't know. Most Zalgo kind of text is just silly and ugly, but especially because you can preview a comment, it would be possible with Zalgo text to use the combining code points that allow you to put arbitrary exponentiation and stack characters up and like stack characters until they are up in the byline area and then try and overwrite stuff. And lobsters is not a high security kind of environment, but we should actually like have a line around the comment that we don't have that kind of thing.

49:55There's a line of data. There's a little bit of a thing happening called the. pushcx https://textslashplain.com/2017…
Think this is the post. yeah. there's this classic blog post called the line of death, where. Below the line is the contents of an untrusted page. Above the line is very important trusted UI that says things like you are on example.com and not eBay.com. And if a website is able to draw things above this line, they can trick you. And it gets, there's more down here because, Clearly that's not everything and recreating browser UI or operating system UI within these confines does work for tricking people on a regular basis.

51:06caffeinewriter My first instinct would be to move the overflow up to a higher container, or potentially add a few pixels of padding around the comment so you can keep the overflow hidden, but give the focus ring a little room to breathe.
So maybe we don't, you know, and a lobster's comment is not quite so high stakes as one's browser window. So maybe instead of having a line of death, we have a, a line of stubbed toe where it would just look tacky.

...39Yeah, Caffeine Writer, that's kind of my first instinct, but also I've worked on this template enough that There's stuff like this text really wants to be left aligned with the avatar and if the user doesn't have an avatar or. Or no, not if they don't have if the viewing user has avatars turned off because some people do. This text of the byline should also be left aligned and match this. And this left alignment should match the story headline and the comment box at the top of the page. And so if we nudge that in two pixels to provide room for this, it will look funny. And I swear it does look funny because we've caught so many of these little like, what if we nudge a comment two pixels? I don't know if Chambliss is around, but she's probably got stories to tell because she's cut her teeth on comment layout stuff. caffeinewriter Makes sense. Lobsters does have a certain je ne sais quoi in its design.
So then I don't know what the right fix is there.

52:57easeout mm. you can't just go around misaligning things.
CalebHearth I showed up late but have we considered targeting :not(:focus-visible) for the overflow directives?
Well it's we try and have a pretty simple low key low frills design and I swear I try not to change core ui very often, although we've had a fair amount of it in the last year, probably more than in the five years beforehand. So, and when I say core ui I mean. The voting the commenting the other thing. Caleb, no, we have not considered that. And I'm considering it right now. Targeting not focus visible. CalebHearth it would break the zalgo text only when focused
I think that might have some really strange effects where if a comment has a link CalebHearth ah yeah jumpy layout
pushcx https://github.com/lobsters/lob…
and a very long line in it and you tabbed into it to highlight the link then the whole comment could reflow yeah anyways here if we can nerd snipe you into fixing it let me paste you the link for the issue So caffeine writer you're new the other like regular recurring thing is I just constantly try and get people to whitewash this fence, do you know rails caffeine writer would you like to contribute to the site.

54:43So. hmm. caffeinewriter I haven't worked with Rails in a bit, but I've been interested in contributing for a while!
Yeah, we had some stuff to clean up here. Right, session access, because the guide linked an issue to scriptures for Selenium, yeah. Quest helper still needs, requests don't allow access to the session. Oh, that? I don't like that. I don't even have to see the link to realize how that works, and I don't like that. All right. Good instincts, Vogel. All right. This is the Felipe I mentioned who's done a bunch of front-end stuff recently.

55:46Why do all of these need to be edited? Huh. I don't understand that.

56:02caffeinewriter I'll probably start perusing issues in the coming weeks. Just slowly recovering from a bout of pretty severe burnout at work.
Oh, I've tried to avoid pulling in capybara.

...16Oh, well, take care of yourself. That's, no joke.

...27Let's see. This rack session access.

...57caffeinewriter This is the first non-work related programming thing I've really done in months. Even if it is just hanging out and chatting. Baby steps!
Oh, so we would be changing the.

57:05Yeah. Yeah, I think Felipe is right here.

58:18So a little bit of shame there on that one, but... Yeah, nice to know. Yeah, that's... Totally reasonable. You know, I would love to give you advice, but I don't know you. And I have seen people recover from burnout in so many different ways. And done so myself of just take time away from the computer and you know, go sit in a forest for a week or play video games or come up with a hobby project to find your passion again. And those things are so contradictory that You know, some people ruminate in the forest and they get worse. Some people get mad at the video game and they get worse. Some people, you know, any coding is too much coding and they get worse. And so, you know, I hope you find something that works for you, given that burnout is pretty rough.

59:34You know, with all of the... gripes about GitHub recently. I've been thinking about how we use GitHub and thinking how much I don't actually like the way it tracks issues or at least feature requests. veqqio I interviewed klabnik today ;D
Maybe also bugs. I kind of lean towards... I think it would be nice if feature requests at least lived in the repo. caffeinewriter That sounds like an awesome experience veqqio!
I think that would let you use the workflow of merging and stuff to kind of accept a feature request and discuss it in a canonical place. veqqio Precisely why I mention it
don't know speaking of klabnik he's joining that jujutsu startup i'm really curious to see what their workflow ends up looking like because i have a lot of hopes i hope they do something radically different there was somebody made a

01:01:03this oh yeah they got the dot org this git forge called tangled that's built on top of the app protocol that powers blue sky and it was kind of interesting i got signed up and i kind of played around with it and i put a test repo up and They are just recreating the GitHub UI with some minor improvements, like your little language chart is up here as a divider instead of over in the right column, and then it has the same kind of issue, pull request, workflow. I don't know. It feels like a missed opportunity to just recreate this.

...55Speaking of Jujutsu, Anyways, Vic, ping me on IRC when you post the interview and I'll get it tagged.

01:02:13pushcx https://flames-of-code.netlify.…
So speaking of jujitsu, I saw this blog post about how the author organized feature branches. caffeinewriter It seems like a lot of Git forges just end up recreating Github over time.
And apparently it was posted in July, but I just saw it in the last week or so. And I don't remember where I saw it linked from. But what they basically said was... Yeah, that's fair. And I think part of the reason Gitforges do that is They are made by developers rather than product designers who actually run a product design cycle and interview users and do user testing. And so the programmers are just recreating the thing they know with the minor tweaks for things that annoy them instead of taking a big jump to do something better. graefchen I tried jj, did not like it that much, so I stay with git. But I probably do not encounter the same problems others do. limesSit
CalebHearth @pushcx I posted an update on the issue about focus. it’s a different approach and I’m not sure it’ll work for all edge cases but it seems workable so far.
And one of the things that I really enjoy about jujitsu, and I'm aware how many of its features come out of Mercurial, but it takes a big jump away from the Git workflow. So this author has a very familiar setup. Oh, I'll take a look before I change gears, Caleb.

01:03:50And Grave, yeah, these kind of workflows are very personal. One of the nicest things about Jujutsu is that it interoperates well with Git so that mostly you can run whatever weird workflow you want with Jujutsu and your Git coworkers won't notice. Focus ring for links is clipped.

01:04:30so caleb i think from your video that this is the same as i don't think focus within is doing anything here because you haven't exercised the behavior in which the nav holder overflows which it does when the window is very narrow And you haven't exercised the behavior where there is a very long line that wouldn't break in a comment.

01:05:13So this is kind of the same thing the reporter was saying was, hey, I don't know why that overflow is there.

...25CalebHearth Fair. without that code I do see the nav links and the url in the comment cropped
and you know they had said if we just dropped it yeah yeah so if you have a local dev instance write a comment with some zalgo text or a very long line and then test the mobile layout of the nav Because, I mean, I can test the mobile layout of the nav fast. caffeinewriter If the main concern is making sure the comment doesn't bleed into the byline/actions, `overflow-y: hidden` might be workable.
I can just do it on prod as long as I'm going to do this in the inspector. So here, if I tab in, and then where's that overflow? It's up on the nav holder. So if we got rid of that, there must be another one. I'm not, oh, I missed a click.

01:06:48caffeinewriter But yeah, that doesn't solve the horizontal nowrap issue.
In any case, let's switch over to the phone yeah, so this is where the the overflow happens so that on very small screens, you can kind of. scroll left and right on this bar. i'm logged out, so there are only four items, but when you're logged in there are more items.

01:07:21Yeah. Yeah, it's one of those balancing issues where it is fiddly behavior that is caused to fix other fiddly behavior.

...43So this is kind of what my feature branches locally look like right now where there's master although I call it main we finally moved over and then you know either stacked feature branches real uncommon for me on lobsters because we're not a lot of development this is a fairly low pace of development and then you know or we have independent feature branches sure pretty familiar and this author talks a little about doing refactoring and other stuff, which is nice. And then they had this concept I found really interesting of branches for the distant future, where a thing that happens fairly regularly is you have like, I'm juggling two different features, whether that's inline or stacked. I guess that's the same thing, stacked or independent. And then also maybe you have some like long-term feature branches, you know, database framework, new UI, where you may end up working on them for not just a couple of days or a week or two, but like months, or they're like, you start them and then you just don't want to forget about them. And they kind of hang out in the background. And what they've done is created an empty commit that they just named dash dash dash to merge up all of their short-lived feature branches and then to be a jumping off point for all of their long-lived feature branches. And when it gets conflicts, that says that the feature branches that are getting merged together have conflicts. And when the long-lived branches start picking up conflicts, that says that feature work that's in progress now is causing problems for them. And so the fact that conflicts are a first-class object in jujitsu where you can get conflicts conflicts and then just ignore them and leave them alone and come back to them later and if you happen to work out whatever the merge conflict is with a commit you add or edit down here it will ripple up through and just quietly get rid of the conflict I don't know I really liked this because I have the kinds of feature branches that the feature branches that users contribute to lobsters, and then sometimes I have short-lived feature branches, stuff like this Markdown thing that's been going on for a minute. The other username thing, this would be a stacked PR. Actually, this one, this one I did on stream, last stream. So this would have been a stacked PR on top of that. The story merging UI, this is a long-term branch that has spawned a number of very short-term branches. easeout yeah the auto rebasing on prior commit edits is satisfying
Since they're all very easy to move around in jujitsu, I kind of wanted to organize like that. And since one of the small values of office hours is to... Ah, hey, Isao. Yeah. Do you do anything like this? One of the values of... Office hours is to constrain my time I am going to selfishly do something that will hopefully just clean up my work environment, rather than be a user visible feature. i'm allowed to do that. caffeinewriter That workflow is fascinating. I really, really need to start playing with jj. It's hard to let go of my git muscle memory, but the conflict fixing sounds like it solves one of my biggest pain points.
So what do we call this single merge point I feel like it could use a bookmark or a name. olexsmir yeah i think jj becomes even more important for me than my neovim(i'm one of those)
yeah.

01:11:59pushcx https://lobste.rs/search?q=comm…
caffeine writer, if you haven't seen, I really got to roll them up as a blog post, but I wrote a couple of comments on lobsters about get and get hub and jujitsu that apparently have come up on stream often enough because people keep getting nerd sniped by me using jujitsu. So I've written a bunch about the experience of starting with it. And the big one at the bottom is like. I guess I'm also saying I've, ah, no, no, no, no. Where is it? Oh yeah, it was right here in the beginning of just like, I've been using Jujitsu a month and I like it more, especially after, you know, since 2012, I've been the Git expert for my team at Jobs. And after a month, I just, my month in Jujitsu has me more confident than my 18 years in Git. That's it. Like this, this is a like, let's redo your workflow and organize your branches and create a merge that you're going to mutate. And I actually feel basically zero stress about it. You know, there's no like, I better get this merge right. I better get these commands right. I better read them exactly out of this and double check everything before I hit enter or else it's going to be a pain in the butt to untangle. Jujutsu is just safe to experiment with. so let's give this guy a description oh it doesn't like that huh i have to say dash dash dash dash dash all right let's okay how many dashes do we want well we were talking about the eight hills of rome so one two three four five six seven eight olexsmir git would be much better and "stressful" to use if it had `git undo`
You don't like that either, huh? So if I do it like this, let's just do it in Vim. olexsmir *and less "stressful"
1, 2, 3, 4, 5, 6, 7, 8. There we go. And I will never accidentally create a commit with that message because what a pain that was, huh? And then I want to add a bookmark for it. caffeinewriter I'll certainly have to read through more of them. I've read a few of your comments, but between Klabnik's guide, and it being a superset on top of git? I really have no excuse to not at least try it.
mark create because i need a name like you know what this reminds me of this reminds me of this one's kind of a nerdy cut but there is a recurring thing that happens in marvel and dc comics american superhero comics where like every five to eight years they like realize they've written themselves into a corner or want to change how one of the characters works in a fundamental way and so they're like oh this is in a parallel universe caffeinewriter olexsmir Agreed. It's certainly less stressful than mucking about in `git reflog`.
then we're going to write a bunch of comics in the parallel universe then they write more comics if it does well and then eventually they're like well let's bring it back together and then they do it again because they write themselves into a different corner and very often these are like the crossover events where like two versions of batman have a fist fight or two versions of wolverine have a fist fight and then they break off again so let's call it like crossover It's just such a dumb name. So Mark creator bookmark now probably create. All right. And then there's gotta be, what's the way.

01:16:00I'm peeking at my jujutsu config off stream because I didn't think I... No, I didn't put anything special in here.

...17There is a way to get a list of all of your branches, and I am not... Is it heads? Nope. olexsmir jj b list
olexsmir ?
no it's got to be in cloud mix tutorial right no github or github jujitsu doesn't track branches like git does and actually i may not have bookmarks for all of these subscriber commits yeah he talks about the opposite where people like anonymous branches and i've been using jujitsu a couple of months and I don't like anonymous branches, but I could see liking them more once I have a crossover point, so I don't lose track of things.

01:17:19Getting the list heads of all that's what I was trying to remember.

...29let's get a little more space all right so a lot of these are remote branches from other people's repos recheck oh so this one this one wants to be on top right so let's jj rebase the branch recheck dev after the crossover oh and i got a conflict

01:18:05It's probably about the gem file, right? Yeah, that's fine. I don't care about that right now. And then who else do we have?

...24This one is dead code. I could abandon that. Common marker. Let's clear some out. CalebHearth jhawthorne made a nice tool called bundler-merge that acts as a git merge driver for Gemfile.lock.
And then kpn is where.

01:19:06oh yeah this was i think this whole little branch was me on a different yeah let's just abandon these so i've oh that's interesting do you have a link on that caleb

...37So this that I'm cleaning up is a thing I've repeatedly done is add recheck to lobsters as I've been working on recheck. CalebHearth https://github.com/jhawthorn/bu…
Who are you?

01:20:23Oh, that's neat. That's a very clever project. I get how that was must work.

...42CalebHearth I haven’t dug into JJ yet but one concern I have is losing the power tools like this. maybe/hopefully they still work
I mean, the naive version of this would be blow away the gem file lock and rerun bundle install. But this sounds smarter than that.

...58Yeah, I wouldn't worry about it too much. Jiu-jitsu seems very much about providing opportunities to have power tools. So that's probably not going away.

01:21:25That doesn't, oh, that's the one I just threw out, isn't it? Yes, okay, that's fine. And then these are other peoples. There was probably a clever way to get Jujutsu to not print other peoples, but that's fine. Oh, another attempt to do crossover, or recheck.

01:22:03olexsmir also you should be able to just write the conflict on disk with git, and resolve it, since jj operates within git repos
this guideline this one this one wants to be on top of the crossover that's been hanging out for a minute all right not r after i think it's capital a but ah okay so i already pushed that one. And since that's a long-lived feature branch that's already public, it does have to be below the crossover point. So how do I edit the crossover to add that branch?

01:23:06That's a good question.

...18You know how I would do it when I started? You can use JJ Rebase to add a parent.

01:24:08Aha, there it is. Now the crossover is a merge point of that feature branch. Excellent. That's easy. That's dead. As was this stream demo.

...38Is this probably also a dead? I removed parentheses.

...59And then did I have any other? Oh, look, I have another recheck branch.

01:25:17bsandro VoHiYo good evening
Headline, this is the one I was looking for, right? Yeah, so this is the story merging UI that I said has been hanging around for a while. So this will go above crossover.

...41Good. This is probably more gem file conflicts, so that's fine. And then I think, oh yeah, solid errors was false start. And I don't think I have any other branches hanging out. Oh yeah, flex, there's some dead code. Comments sort. That was an experiment.

01:26:16What is this?

...23That's code I'd like to get back to. Base dash R context after the crossover. The real interesting thing about this workflow is going to be maintaining this crossover point. And do I have to... I guess I will have to rebase it to... Update the current head of main. We'll see. Oh, I started the username throttle that has made it finally back onto my to do list. And what is? Well, there's a bunch of stuff here. I said this one merged. This one.

01:27:26Is that stalled attempt to move avatars into the site? Yeah. Do I want to? Yeah, let's just shove it after.

...57It's up on GitHub.

01:28:07What is this one?

...33repaginate. That was one of the early things I did on the stream that also stalled out. No, this isn't the one from 2020.

01:29:11Must be up on GitHub.

...18What is fixing the tag layout?

...40veqqio It is really enjoyable reading this and seeing such a workflow. I don't have particularly complex commit graphs at work so
veqqio *watching
Oh, this bug got fixed.

01:30:07yeah lobsters is kind of at a funny level of complexity where it's big enough that you have to be careful about some things and it can show design issues but it's small enough that we can just pledge things into working and you can get your head around it in a couple of hours if you know rails well this one I don't think we need this. Yeah, I was trying to add this to Rack Attack.

...52But... Oh yeah, this is two years old. So there is a... persistent attacker on the site that i call the enumerator i don't know if i've ever mentioned them on stream so maybe that name doesn't mean anything to anyone but there is a bot that is constantly spidering the site to see what usernames exist so they are enumerating all the usernames and they clearly have some giant dumps from somewhere else and they also have access to bright data or are one of the other malware-based vpns so on ios and android if you install i don't know a flashlight app or an app that makes a fart noise it gets unrestricted access to the internet So when you are, even when you're not opening the app, it may run in the background and resell your connection to be a VPN for bad guys. caffeinewriter Bright Data is so unbelievably creepy. And they're arguably the most "scrupulous" vendor in the space.
We've had a story or two on the site about this over the last, somewhere in the last year, year and a half, I want to say. And so we have a enumerator on the site who uses one of those to attack the site for credential stuffing like we saw this morning.

01:32:37This has got to be merged. Yeah, this is just like whitespace cleanup. That's fine.

01:33:00And then these are going, yeah, these are going many years back. Okay, so nothing back here do I need. So if I look at our log now, here's our crossover point. Here's some stuff I shoved on top. Headline should be on top of crossover, not context.

...33That's not what I expect to see. Why are these two things in order instead of being two different branches?

...58I don't have to worry about it right this second. So recheck is fine, and then main is fine. The guideline is down here. Oh, the crossover needs to have main merged into it.

01:34:31That's what I would like to see. Now, why is context on top of headline?

...49Let's just name this one commit. I think when I give a bookmark, it wants to take multiple commits and so

01:35:05It's trying to help me because it assumes I have multiple things on the branch. Yeah, so like when I'm telling it to rebase, it's grabbing all the commits there instead of just the one I want to move. So I'm... And now recheck is up there. And that's not what I want. All right. JJ, undo. All right, that's less bad. I can sort that out later. But now I have the crossover point I wanted. I have main. I have the guideline hanging out. This can go away. All right. Oh, I remember what this is. Yeah. Yeah. That's dead code now. All right. Getting tidy.

01:36:17All right. So there's that done. Can we cache short comment redirects? Yes. That's where we want to be. So let's make a new branch off of main.

...38where are we so we're here which comes right back to maine okay so for this we are gonna go look at the caddy docs which i'm pretty sure are in light mode so don't be shocked

01:37:07Oh, no, I heard AWS was having some more trouble today, I guess. That's that trouble.

...19Or did they get a new website? This is a different domain. I'm not.

...44Yes. No.

...53Oh, so yeah, new logo. And they say caddyserver.com. Okay, so I guess it changed domain names. Or I was visiting some knockoff site for a while. That's disconcerting.

01:38:19So let's teach it how to do a redirect.

...28So the thing I most want is to give it a file of redirects. I don't want to have to put the redirect in my caddy file. Tens of thousands of domains? Well, I do have hundreds of thousands of short IDs.

...58Yeah, I guess what I would like really is for Caddy to have, I hate to say this, but a database where it's going to take that comment shortcode and look up the full URL and Don't know if there's a way with matchers to do that. So we can have request matchers so we can classify things.

01:40:07olexsmir web server with database sounds so cursed
pushcx https://github.com/roomaroom/ac…
Well, you know, Olexmere, the other thing I would like is for Caddy to take over serving our full page caches because we use a gem called Action Pack Page Caching. And the concerning thing about this gem is last edited two years ago. olexsmir ouch..
This was extracted from Rails many years ago and has basically been unmaintained in the four years since. I don't know what this one random commit is. Great. So the way this works is when Rails serves a page it looks at it and says okay the user is not logged in they don't have a tag filter set so this is the same page every other user is going to see and then or every other logged out user is going to see and then where is it's in hatchbox caddy file i think i put it in pre yeah so then this full page cache caddy goes okay so if you are a visitor and that's the matcher for you don't have a cookie and then it also says okay so if in the directory that action pack caching writes to and that file exists caddy can serve it this is ridiculously fast this is why we have had the last couple of years where sites have been falling over from aggressive badly written crawlers where they haven't affected us is because this cache is so wonderfully performant because olexsmir yeah that's basically free
caffeinewriter Perhaps you could import a file with a `map` directive?
look up a file by one of three file names is very fast especially because this does it does one it does them in sequence and so typically it only has to do one actually i should reorder this sequence because it's going to be the first one way more often than it's going to be the other this one yeah great so there's that

01:42:53So if I can get this extended to handle the 302 redirects for those comment shortcodes, the thing that knocked us offline on Saturday is not going to happen again. Because caddy will serve those in zero time. Caffeine writer, I don't know the map directive. I know barely enough caddy config to be dangerous. And this was me reading the docs to be like, wasn't there something in here? So if I said, yeah, the nice thing about these is I don't have to do the visitor check. caffeinewriter I'm not familiar either. Just some furious googling for a few keywords that I had a hunch that might work.
So what's map? olexsmir now i wanna look into caddy even more, thanks for inspiration ig
So we map a matcher from a source to a destination. This sounds nice and generic.

01:44:13Magic number. That's a little disconcerting. What is the magic number? Number of outputs for each matching must not exceed the number of destinations.

...35caffeinewriter The documentation on this is frustratingly obtuse, but it looks like it might be workable?
This switches on the value of host. And then if the request is example, set my placeholder to some value. Oh, so it's saying you can set multiple variables.

...53so oh alex mirror to finish the thought because you can write lua plugins for caddy what i would really like to do is have a like very small lua plugin that says oh instead of action patch caching shoving things onto the file system because we actually have enough files that we have file system churn because of it shove them into a sqlite database And then caddy can retrieve them from there. And I've drafted the caddy plugin. I haven't tried to write the Rails side. I think that's on my personal GitHub, right? How do I browse my repos?

01:45:50pushcx https://github.com/pushcx/caddy…
Yes. So someone had written a file system thing, and then I hacked it up so that instead of throwing an exception when the file doesn't exist, it just does a pass-through, because it's intended to be a pass-through cache. And, oh, it wasn't Lua. This side of it was Go. Yes. Which I don't know. So I did a lot of copy and pasting on this. It compiles. What I need is somebody who knows Caddy and knows Go to take a look at this and be like, oh, yes, this is reasonable. And then I can take this SQLite database and I can hack up ActionPack. full page cache or whatever the hell the gem name is. And I can maintain my own little fork of that that talks to this table. And I can write a job that says, okay, well, let's delete things out of the cache when they get expired.

01:47:17olexsmir you know that you have to do file.Close() in if err, so you know more go than most of my coworkers : D
In which case I will probably add one line of JavaScript to the site because our relative timestamps are a pain for caching.

...36So the thing I want to avoid, Caffeine Writer, is

...47Alexmir, if I got that right, I was copying it from somewhere else in this file. There must be another dbclose in here that I pulled it from. Or... something. You should not credit me with having any amount of Go knowledge. caffeinewriter I'll be upfront, I don't have nearly enough knowledge to give input on potential pitfalls or footguns with regards to Caddy.
But it sounds like you know go so if you would please review this commit and Tell me if this is correct. olexsmir i can look into it, but i dont know anything about caddy
That is a very useful bit of help Fair enough caffeine writer We will figure it out live It may not even be possible Variables yeah, I kind of want variables I

01:48:59Alex merits that idea which would be like long term useful to the site has stalled because I don't have somebody who knows go so. You have a big leg up on something that is probably useful to our long term health and. If caddy can be compiled with that module or I think it was like the module is compiled and then it goes alongside and that actually works and it doesn't. See, I don't know enough Go to know that I didn't just write a giant memory leak. I don't know enough Go to know that I didn't just copy untrusted user input into a file name or into a key name in a way that could be immediately breaking stuff. caffeinewriter I know a little bit about a lot of things, but usually just enough to get myself into trouble.
veqqio It looked good to me at the time, iirc
And so it's those kinds of foot gun things that I don't even know how to look for them or know all of them in Go.

01:50:01What is import? Snippets can process arguments that are passed to the import directive. Oh, yeah, this is how we got the caddy file pre and post thing going.

...22So with import, if I had to, I could have the Rails server I don't know, every 10 minutes, write out a file that looks like caddy redirects. My one concern is like, all right, got a little light mode warning here. My one concern is that it's gonna look like we have 650, 50,000 comments times, what is that? if it said like a redirect A to B, well, the B is gonna be longer. olexsmir looked good to me, but will look more tommorow, because it's always bad idea to judge code at 23:00 : D
So each one of these is gonna be, I don't know, realistically, call it 80 characters or so. And now we're putting 49 megs of data into the caddy file like that. That seems like a lot of caddy file config. Well, thanks, Alexamir. I appreciate it. And, Vek, do you know Go? veqqio Yeah, I looked over this back then in a call iirc
I mean, maybe it's even just you spend five minutes writing tests on it because I don't know how to write tests. And then you go, oh, yeah, no, this is trustable. So... veqqio call -> this twitch
I don't know I don't think adding 50 megabytes of text to the caddy file is a great plan, I know it compiles it but. caffeinewriter I wonder if it'd make sense to use the Caddy API for the comment redirects?
yeah it's been a minute it's been a couple of months, but I recall that. there's a lock. evaluated.

01:52:29optional block to pass the imported tokens. I think it's just saying I can use curly braces. Yeah. Okay, so it's just a text substitution thing.

...54You know, I don't, I wouldn't, actually need 650 000 individual lines i would need whatever our number of stories is i want to say around 120 000 and then i could use this to say well you're going to rewrite to the story url and then you're going to take that comment shortcode and put it on the end in which case I guess that's only adding 120 kilobytes, right? What is that? So it fits. Let's bring that back on. 120,000 stories times 80 divided by 10, 24. caffeinewriter And to be fair, I imagine a not-insignificant amount of stories have no comments at all?
10, 24. So that gets me into only 9 megs instead of 65 megs of caddy config. So great, I'm already saving 55 megs of RAM. And 9 meg config files, I feel like that's going to be breaking something if it even doesn't just run into a, hey, you're not allowed to have 10,000 rules kind of limit, right? Caffeine writer, yeah, they're very distributed.

01:54:28you know, this is only a couple of days old, this database. So if I said, select stories, count comma account star and from stories group, one order by two desk now order by one ascending limit 20. So.

...59Not stories count. That was accidentally the distribution of merges. We want comments count. So yes, what is that? 40% of the stories on the site have zero comments. So you can see the kind of distribution we're looking at. Well, I guess what I'm also saying is, you just saved like four megs of RAM because we wouldn't have to list those stories. So now, you know, we're getting there. We're down to four and a half megabytes of config, which is all of this is a bad idea. You know, I think we've got to get it down to like three lines of config. If we're measuring our config file in megabytes, we're probably doing something wrong. Oh, that's a good line.

01:56:06caffeinewriter That's delightful
pushcx https://push.cx/stream
so caffeine writer the idols on the archives are silly things that get said during the stream yeah if you go to the archive it's linked below but here it's fast enough to type if you scroll down you'll see they have lots of very silly titles veqqio wrong link
You know, I almost could just... Hmm. What if I made a Ruby middleware?

01:57:06Is that not the stream archive? veqqio Oh, nvm. Sorry. I thought you wanted to link something else :D
No that's the archive scroll down past the fact, and you will see the list of previous streams.

...20veqqio Im mildly distracted
caffeinewriter I was reading through "I'll let you know if I ever see a responsible adult" before I joined today, haha
So I almost wonder if I could make a. Rack middle where. chamlis_ a string and sticky tape solution: write out a tiny html page to the cache that does the redirect
A Rack middle where that. just kept the story IDs to URLs in RAM.

...51Oh. Yeah, Chamos, that's exactly it. caffeinewriter chamlis_ That's a really good idea
Yeah.

01:58:09caffeinewriter Same solution as the cache, essentially
Yeah, that would work. I can write that code in my head.

...22chamlis_ I don't know if that will take up a huge amount of disk space, and obviously it's slightly less clean for clients
And then we've got 650,000 files on disk, but that's not a lot.

...33Yeah, I mean, I guess the clients would have the HTML file with in their background, right? So like, and we just have a meta refresh, right?

...55So is this the equivalent of a 302? I'm wondering if this is going to be in the history because that's obnoxious if you click back and then back doesn't work because you land on a page and then the page redirects you to where you were. Meta HTTP Equiv.

01:59:23What is this content three? Oh, so that's the seconds. I want zero, but

02:00:04Yeah, yeah, yeah. I don't need the status. Thank you for being pedantic. I just want the flow that it doesn't junk up your history.

...28Yeah, this is the bug I don't want.

...35And ahrefs, they actually know what they're talking about. So it's not a lot of disk space. It's not a lot of inodes. Well, it's a moderate amount of inodes. chamlis_ yeah that's annoying
But then it breaks the back button. Because realistically, I want to say content zero. I can do a lot of nonsense, but I can't break the back button.

02:01:44All right, so I think Catty, or Chamlus, as much as I like that idea, I think we have to get Catty to do this somehow.

02:02:12And I guess... That seems unlikely because what I'm saying is I have a set of key value pairs and I have a large set of key value pairs, you know, large by the standards of a config file. In which case, how is caddy going to know what a key looks like? What's a valid key? What kind of data structure is it going to keep it in? What kind of schedule is it going to refresh it on?

...58This is not what I searched for. chamlis_ is the slow part hitting rails or hitting the DB? would putting the comment -> story mapping in the sqlite cache be good enough?
So yeah, you can have a map

02:03:44That's a good question, Chamus.

...52And we have enough logging to know, actually.

02:04:04olexsmir about the go code, i go way to interested and i found only 2 potential problems
olexsmir where should i send the "review"
So I can see how to get there with include in map now. I don't know that Caddy would like that many, but...

...19olexsmir only if it were PR
caffeinewriter Maybe an issue?
alexamir can you just write comments on the commit i think you can click the plus sign on the diff right and then just leave them in line or yeah i don't know what else or honestly you could just olexsmir oh it works for me
right or you could pull back pr any fixes you see because i don't like alexamir all i'm going to do is take your review and figure out how to write that so if you want to pr to that repo so here is one of the oh no wait I know where to find one of the IPs. I'm trying to find one of the bad IPs.

02:05:26Ah, here we go. So the ranges I saw first were these 47 ranges. So let's... Come back up to lobsters. Jump over to the log directory, which I still don't have an alias for, but I keep thinking I have an alias for. chamlis_ ahh, the spammers are star trek fans I guess
I got these not sorted. Maybe they are.

02:06:39How does Star Trek work there, Jamlus? I'm not getting the reference.

02:07:07chamlis_ 47 was a writer in-joke that cropped up in a bunch of places
Text compresses so well. So let's see. 47 was a writer in Joe. Oh, okay. It is also a range largely owned by Alibaba, who kind of doesn't give a crap about being a good network neighborhood. Unfortunately, Katie had given me a link to someone complaining about this exact IP range and saying they tried to contact the network owners and just got ignored.

...47So today is the 27. While in server time, it would have been this one, right? I'm going to jump this off screen so I can look at it without Showing Rando's IPs. Oh, I don't have gzcat installed. caffeinewriter Ahh, I think I remember that article. Was it β€œBro, ban me at the IP level if you don't like me!”?
Okay. This is the wrong log file.

02:09:14That's totally possible. pushcx https://boston.conman.org/2025/…
Yes. Yes, it is. Thanks, Caffeine Writer. That is the exact title. What did I just do with those IPs? Because I need the other ones.

...48caffeinewriter I just read that a couple days ago, so it was fresh in my mind.
They started 47. Why am I not seeing these? When did this log roll over?

02:10:12Hmm.

...41I'm gripping the logs on prod. I wonder if I miss pasted an IP or something, because it was definitely 47, but I'm not turning up a million hits like I expected in the logs.

02:11:19I'm doing something wrong.

02:12:18Oh, I think I got it. I think it's just a dumb typo. Sorry, not exactly a riveting TV when I'm fighting with stuff off screen, but I'm trying not to just, you know, show a million people's personal info. And it's not. caffeinewriter Good practice nonetheless
Super sensitive that some IP has visited the site, but all right. So this is only asshole traffic. This is the bot.

02:13:06So yeah, until they got banned, they did 44,000 hits in under a day. which given that they were only active for an hour or two, so their first one was at 002 and their last one was the end of the day. Oh, I must not have noticed them until the next day or something. But yeah, this is just one of their ASINs most of their traffic was coming out of. this prefix, but certainly not all. So this is just kind of, you know, slapdash engineering where we just need to be right enough to deal with the bots. I don't actually need to know the exact number of hits they threw at us and all of their ASINs and all of this other stuff. I just need to have the site not fall over because of these jackasses. I spent so much time hassling with the logs, I don't remember what I went in here for.

02:14:32Ah, the timings, the timings. So the duration is 8 milliseconds or 6.49 milliseconds view is zero db is 2.8 db is 3.5 i'm kind of skimming up yeah so when it was busy 55 64 you can see the site is slowing down but it looks like database time is most of it, because I'm kind of comparing these durations of if the overall duration is 35 milliseconds and it spends 30 in the database, well, we could do 10x better by not touching the database. Maybe that's only 5x.

02:15:32So let's grab all of them.

...46Actually, let's type it to head, because I never get jq right on the first try. And we will say dot duration dot db. Ah, what is this syntax? Pipe? Speaking of never get jq right.

02:16:17caffeinewriter `.duration, .db` I think
I'm checking my personal bash history to see if I've got this syntax handy.

...42Looks like I do.

...50OK, so it was jq-c-r. Well, it is JSON, because after these graphs. And then I just want duration, comma, db. And I want to spell duration correctly. There we go.

02:17:35chamlis_ looks like non-db time is pretty constant
Yes, you can see some of these are starting to slow down. Some of them are like single digit number of milliseconds, which is acceptable, but then some of them are huge. So it's the database getting overwhelmed. Yeah. like the difference between these two numbers is just constantly like four and five milliseconds which is i guess that's acceptable for ruby all right so

02:18:24olexsmir submitted a PR, if there was no memory leaks before you, you haven't introduced new ones
Given that comments can't move between stories,

...54So this is redirect from short ID.

02:19:05chamlis_ do merged stories need any special care?
So this wants to be. No, because who do they? Hmm.

...27Let's double check. I know we've been merging stories with Ruby recently. So this one. But that's it's all on the first one. Hold on. Let's find one that had more comments. I've had several more comments. Let's drop down, and then

02:20:04Yeah, so it got, this is the short ID of the top level story and the short title of the top level story, which is also visible here in the comment target path. So these do expire on story merge.

02:21:20Thank you.

02:22:00olexsmir never written any ruby, but code looks and reads real easy
Yeah, it's pretty straightforward. The blocks like I'm writing right now can be a little bit clever, but...

...43Think how to cut this down to only hit the database once. olexsmir also it looks like strange version of lua Kappa
Because what I want, yeah, see this, I don't actually want to call this method because it's going to hydrate the story object, which is probably a non-zero part of the runtime is having to go fetch that.

02:24:03So off screen, I'm grabbing that short ID.

...22So instead of doing this, what I really want to do is story where Can I say, you know, not like that. Joins comments. Where.

...52Comment. Short ideas, this. Right.

02:25:10Because what I need is the story. But I only need those two fields. So I could say, select the short ID and the title. I only need the first. why are you nil because the comment i'm actually testing with is not in my local database because i was looking at a ruby thread that's 10 days old which is older than my database let's go to the last the prior ruby thread because the this is the dhh disaster that does disaster that just keeps on giving Oh, look, it's coming by me.

02:26:26Okay, so there, that got a story in one database hit. So then if I said, give me the, chamlis_ do you need the merged_into_story_id as well?
routes title path let's say title url because the redirect has to turn into a url anyways so that's correct but then we have to put the short id back on the end of it yeah so let's just grab this speaking of things that we are small enough to do chamlis_ ooh nice
yes i was gonna coalesce that all right so right except it's got to be a yeah so let's pop up a little here

02:27:55How do I... So I want to take this... And I don't want to be calling toSequel on this nonsense all the time. I want to be calling... Is it merge?

02:28:24Yeah.

...41And I want to force it to alias that inner stories.

...56Can I say, is there an as method?

02:29:09No, I just got to join it. Let's do the ugly thing.

02:30:45Literally missing the word join. That's what I'm trying to say, except I also need the where.

02:31:25what did i do that you don't like this didn't get quoted oh no that's valid actually all right

...58Oh, it's the comma at the end, isn't it? ID is ambiguous. s2.id. There we go. So this one, yeah, so this one here does have that. All right, so this is ugly, but it works.

02:32:33It's basically my performance review at work, right? So story, do this pick joins, where, give me just the field I need, give me just the first one. And then we are returning the, title url for that story plus which yeah can we make the routes extra add an anchor so that's the oh i already have it how great

02:33:47Ooh, that feels bad. Except I've looked it up by short ID, so I know it's a valid short ID.

02:35:36I don't know any good way to do this except to call back, unfortunately.

02:36:07Let's put you in order.

...39And then in the after save, I'm trying to remember the way dirty works. Is it changed or is it changes applied? And the API for that.

02:37:21Oh, no, I don't want to call it. I want previous changes. And mutations from database to previous changes. Yes. Yes. OK, so we want to say redirect unless merged story ID previously. changed is there a question mark at the end of that yep it's a guard clause let me have it standard the linter is helping and then we want to say what's the cache api can i do a wild card

02:38:36Clear. Nope, not the entire. Delete. Can I give a partial delete matched? There we go.

02:39:41so rails man i'm getting tired if i can't spell rails cache delete matched abc I was hoping to see a SQL command go by. So I can give it, I think I want to give it delete multiple. Delete multi, which takes an array. So if I said C123 and C456, Yeah.

02:41:49Comments controller, redirect controller ID.

02:42:03Yeah, this is, I mean, so much for layering, right? But that Rails makes this kind of possible is handy.

...18instead of calling it C underscore, which is that comment anchor. I'm going to call it something like comment short ID. olexsmir going to sleep, have a good rest of your day
Sorry, got a text there. So we said.

02:43:21Have a good one Alex smear thanks for taking a look at the go I really appreciate that it'd be nice to take that off the back burner.

...47propagation operator.

02:44:00I think there's an active support method for this. If I said one, two, three.

...23Yeah, that's a problem because these can start with a number.

...59Fun with regular expressions.

02:45:10So if it's the administrator and they are asking for a raw ID, which this is one of those things I use like every two months, but then it saves my bacon for having to look up short IDs when I'm messing around in the database.

...42So it's OK if that's a little slower. And now this just needs to handle the not bound. What part of this is going to break if the short ID is not found? Probably the first, right? I think that'll be nil.

02:46:15Story.where. Yeah, actually, I don't even need to run the whole thing, do I? So if I take this and I said not that, I'd get a nil. So in that case, how do I break out of the Rails cache fetch?

...46Because I want to say, I think it's actually smart enough. So let's say Rails cache get ASTF find. Oh, I'm on the null store. That's not going to do anything for me, is it?

02:47:36And then I don't have prod gems installed, apparently. Why are you looking for exception notification? I removed that ages ago.

...56chamlis_ you can do `rails dev:cache` to enable caching
chamlis_ had to do that to test the stats graph stuff
do i have a production rb here that's old oh that's true yeah there's that foot gun that i like to keep shooting myself with

02:48:32all right well at least that's correct so rails cache fetch asdf and then we will do we will just return the string i don't know value good and now the block doesn't run which is correct and if i had said instead i think i want to explicitly return nil we'll make this number two unexpected return yeah i don't think that's because i'm in pry right so if i said defu let's go to three

02:49:38Come here. Oh, OK. It was just because I was in pry. So it tried to find the value. It failed. And it returned. Did it return straight out of the block?

02:50:11Yes. Okay. I never remember how many levels of cache gets busted here. But this... The thing I was looking for is... the Rails cache sees that the fetch block did an early return and doesn't go and stick that in the cache because that's not what I wanted.

...43So I think that's correct. Oh, and then watch this. Something incredible and unusual is going to happen. I'm going to remember to turn off the dev cache and make sure that I don't have any fucking rendered pages cached, so I don't waste 10 minutes on that again. chamlis_ haha
Magical. chamlis_ defer for the shell when
It never happens that I remember to turn that off. All right. Yeah, Chamos, I don't know if you were here, but there was a was a stream like last one of the one before and i lost like 10 minutes to why am i rendering not the page i think i'm rendering why are these tests failing and then i remembered the i had turned off dev cache but i had left the cached file on disk because that's how action pay action page caching gem works and that'll get even worse when we put it in the database because i'll always have the database caffeinewriter defer is a feature I never knew I needed, until I experienced it in... I don't even remember which language.
foot guns will continue until morale improves you know if i do this not like i've got time left to do anubis but if i do this I don't think I have to do Anubis. Or at least it becomes a want instead of a must. Cache delete multi. Oh, I didn't put it's rails dot cache dot not underscore.

02:52:41Yeah, Chambliss, I meant to ask, what is defer in this context?

...56Okay, that's positive. chamlis_ I'm imagining you running `dev:cache`, then `defer rails dev:cache` whilst you remember and it runs it when you exit that shell
But then the failures in comment spec are exactly the feature we're testing.

02:53:17graefchen I understand defer. But I don't understand it. limesO
Ah. yeah the well but the hassle is i also need to remove any pages off disk that i cached because even if dev cache is off rails will serve from the cache because it goes oh you're and i think it's because the cache is in the public directory which it doesn't need to be anymore no it only matters that these two things stay in sync right It was like a very Nginx, or honestly, maybe even a very Apache thing that we shoved it under public because we have that. And then where is that configured? Action pack? No.

02:54:47caffeinewriter My favorite go-to use is closing file handles, so you can `file.open()` and then immediately after, `defer file.close()`. We're also getting something like it in JS with `using`/`Symbol.dispose`. Also, apparently markdown inline code backticks are hardwired into my brain.
Maybe it's a default in action pack caching that it shows in public cache. If we got rid of that, ah, yeah, CaffeineWriter. One of the things I've grown very comfortable with in Ruby is being able to say things like this. There's also the version of that of, you can say like, instead of saying file equals file.open, dot, dot, dot, and needing to remember to close it, you can just write, file.openastf do and the pattern of I want to open a file and then close it is so common that you do this and it basically wraps it all up with a rescue unsure or an end to make sure your file gets closed. And that level of do the thing I obviously want is very nice.

02:55:58caffeinewriter Yeah, that's super nice. Similar with Python's `with` blocks. I think Golang was the first one I saw defer in.
yeah right there if we changed this directory i would stop foot gunning myself in dev because it's the way puma works in dev is if i ask for slash i don't know what favicon.ico it goes and looks in the public directory and if I have dev cache enabled, and I visit a page. It writes a page to the public directory, and then Puma serves it before Rails sees it, even when dev cache is off. Yeah. All right, well, let's put that on the list of stuff to do before I forget about it.

02:57:08Could it ignore the cache so that it stops getting checked in? That's happened before. Must update caddy config. Must update deploy script that clears. There's something else. Must update whatever expires the page cache now. Like all of these things are just connected by a string. And since I'm tired from three hours of talking, I don't want to YOLO a change that has to be made in six places. That seems like a bad plan. All right, so let's go fix the two failing specs. And that's going to be about the end of the stream.

02:58:14This is a cache miss. I wonder if, so comment spec 138.

...29Okay, did actually, I wonder if this could be the cache being off in test. What do we think? I'm going to just kind of def debug this one second.

02:59:22Never remember this switch. Just want to run these two over and over. So I want it fast.

...56chamlis_ are you ever making a redirect?
Oh, yeah. chamlis_ should the redirect be inside the cache fetch like that?
no it helps when you're redirecting to actually say redirect huh is that the bug it's redirect two one save redirect pass allow other host oh because i gave the whole URL. You know, I actually want this outside. Oh, and you said it just as fast as I realized it. Let's get rid of these blitzes.

03:00:50Find method story. What line? one oh five oh the story object is not out here this needs to return well it really needs to return yeah okay hang on this this part goes in here and then we redirect to the url okay there we go am i allowed to catch a bug faster than chamlus can type because obviously she saw it. I just typed faster than her because I don't have Twitch lag. Unsafe redirect. This is probably some finicky thing about the test setup. So if I looked up the title path and did a redirect, probably the test is green and production can handle it. That looks legit.

03:02:00Yeah, the Rails stack is transforming that path into a URL in a way that is happy with the temporary domain used by the test suite. Let's double check this. Let's run the full build. And this may be, oh, you know what I should do? Because I saw it coming. I should get my little last call banner up. This is going to be a short last call. Sometimes it's up for five or ten minutes. Just one more bug. Just one more bug. Okay. Let's review. Let's describe.

03:03:42Yeah.

03:05:24See that, Chambliss? That is your second callout in somebody's commit, right? chamlis_ you're all too kind
In the last week or two, because ease out kconner on GitHub did that other bright idea of yours. chamlis_ put the slow thing in the cache? on the cutting edge here lol
You say that we are being kind, but you are the one thinking of the right strategies for these things and hanging out and contributing your time. So thank you.

03:06:11Are you sure you're not Midwestern? Because there is a Midwestern thing where we go, no, thank you. No, thank you. Thank you. Yeah. We can do that for a minute. chamlis_ my pet theory is that the midwest is the closest to the UK in the US
I'm not going to call out that I kludged in some little fixes for the caddy config and the bash aliases, which means they're going to blow up. Closest, you know, you say that, but we literally have a region called New England. chamlis_ ye olde england
And you're there in Old England? I guess we're not doing Levenstein distance, huh?

03:07:00All right, so you know what? I merged and I didn't. So let's merge that one PR and I didn't pull it down locally. So let's rebase onto it, right? Yeah.

...34chamlis_ oh yeah, in case it didn't link through, I opened the PR to SVG graph upstream, not sure how reviewing+merging it will go
and gg let's see that i have the structure i expected yeah okay so the crossover i gotta go reread collab next article on maintaining this kind of commit because he says something about having a workflow where you maintain edits to multiple branches and you see that as soon as main moved it kind of slipped out Oh, yeah. No, you shared that link. Have you had any activity on that PR? I remember looking at that maybe a week ago. It wasn't last stream, right? It was two streams back.

03:08:26Push that up. I'm going to fire off this deploy and wind down the stream. chamlis_ I can't remember... a contributor had a quick look and seemed generally positive, but nothing for a couple of weeks
Yeah, so we had SVG graph two, right?

03:09:01Oh, I think you missed that they asked you a question. I think if you... name that you looked at it in chrome and firefox you might be able to move this along maybe the other thing here that would be useful would be to link to the mdn or the can i use tables of compatibility because my understanding was that what you rewrote to was very well supported. Yeah. chamlis_ maybe they missed that answer in the previous comment, I'll go and bump that
So I think if you linked to the can I use or the MDN pages for these, that's what the contributor is looking for. I was wondering what clients you tested it against.

03:10:15Ah, yeah, I think... Did you edit this two seconds ago? Because they're still asking? I'm confused by the chronology. 421, 417...

...46chamlis_ I edited it a minute or so before they left that comment so it's annoyingly ambiguous
It doesn't show me the timestamp. I don't understand the order of operations. Anyways, I was going to say, I think you did the opposite. chamlis_ I read "I was just wondering" as "I'm not wondering anymore"
You linked to the... Ah. But also, you linked to the MDN about why you didn't do this. Or the can I use about why you didn't, as opposed to... Oh, as opposed to I'm still wondering? I follow. Yeah, because I scrolled down and skipped this, so yeah. Yeah, I don't know. I would say just describe the actual thing, because you link to the one you chose not to use, which is the opposite of what they want reassurance on, I think. I don't know. Maybe I'm just misreading, because I've been streaming for three hours, and my brain is melting a little from being on stage. chamlis_ haha, thanks for the advice, I'll add a todo to bump that and give some more details
In any case, that deploy finished. These have started taking just over 30 seconds instead of like 25 seconds. So I don't know about this. That's like a 40% slowdown. Can't live like that. Alrighty, on stream. Didn't get to Anubis. I should, close already. I should file an issue about how I want to implement Anubis and down here i was going to double check this so here they talked about steve talked about working on all your branches simultaneously this was the thing that i wanted to tinker with for that crossover post anyways so that has been the stream i should be back on thursday morning there is the possibility that i have to do a fairly late cancel on thursday because there's a family in town and i'm trying to catch up and we'll see where it lands and y'all are great but you know if i get to see some out of town family for the first time in a minute i'm gonna take it so yeah you can watch either the site footer for that or chamlis_ thanks for the stream!
my blue sky account but i do hope to see you thursday morning that's all i got yeah all right everybody take care ah thank you to channelists