I'm griping about how active record works mostly

Streamed

Reviewed PR #1527 for moving stats graph generation to a background job. Investigated several CSS layout issues including a bug with comment anchors and display:contents breaking accessibility. Explored issue #1543 about alignment problems in mobile Safari. Started database refactoring for story merging, planning to split stories into headlines and stories. Added TypeID for better unique identifiers to replace our collision-prone short IDs.

scratch


topics
  stats graph job PR https://github.com/lobsters/lobsters/pull/1527
  learning rails
    https://guides.rubyonrails.org/
    https://pragprog.com/titles/rails8/agile-web-development-with-rails-8/
    book club! https://rubycentral.org/news/the-ruby-central-readme-feb-2025-newsletter/#join-us-on-slack
  upvoter hard to click on mobile https://github.com/lobsters/lobsters/issues/1535
  political thread https://lobste.rs/s/fkw9va/tools_i_love_are_made_by_awful_people
  alignment https://github.com/lobsters/lobsters/issues/1543
  comment anchors https://developer.mozilla.org/en-US/docs/Web/CSS/display#display_contents
  comment previewing broken? - nope, but layout bug, screenshot -> 1534
  terminal config - operator sans mono LIGHT italic; added alacritty config to my colorscheme gist

merging ui https://github.com/lobsters/lobsters/issues/1456
  (stories -> headline, stories) or (stories -> stories, posts)
    incoming FKs: comment, hidden_stories, links, moderations, saved_stories, stories.merged_story_id, suggestions, tags
    hidden/saved stories go to top level, all others stay at lower
    are we breaking ui around saving and hiding stories? (if top thing is headline)
    or are we breaking community familiartiy by calling stories 'posts'
  typeid https://github.com/jetify-com/typeid
  https://bookshop.org/p/books/roget-s-international-thesaurus-8th-edition-barbara-ann-kipfer/17364547?ean=9780062843739&next=t

title

post-stream
    

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

Recording



01:25Good morning. There we go. It's Thursday. This is Lobster's office hours. I'm Peter. This is Saab. And this is Lobster's, the website. So let's see, where am I? So this morning I fixed a, it's not on GitHub issues, so don't look, but, Somebody got a 500 disconnecting a Mastodon instance. That codebath has had to have a whole bunch of rescue statements added to handle the case where Mastodon instances are no longer up, whether that's they've been turned off or they're just crashed or their domain expired or one of those rescues had a typo in it. And of course, everything is dynamic in Ruby, so that didn't break until prod. And I just got that fix pushed, and then I got a Dependabot warning. So let's take a look at that. It's another, I swear, half of them are no Cogiri. Parsing is hard. So what's the CVE? We don't use Python. We don't validate schemas. So I don't think either of these matter to us. I will just bump Nokogiri and move on. So anyways, this is Lobster's office hours. Oh, I didn't turn on the footer. Let's turn that on. So now if we go down to the bottom, usually I remember to turn this on. I've tried to automate that. It is weirdly hard to add an interactive element to an OBS script. I mean, I say weirdly hard. Interactive UI is such a pain in the butt. All right, so let's just go ahead and bump that.

03:56Let's create those CVE numbers.

04:03It's not even a little what was in my clipboard. Come here. GitHub's, it's also, I can't even select it because GitHub keeps, GitHub's UI has gotten so Reacty.

...44So let's throw a note in the Twitch chat while Ansible runs.

05:05pushcx This is Lobsters office hours, you can drop a question about the site or codebase in the chat anytime.
All right, so with that, I'll let that finish. Oh, speaking of, I see the bump to install the recent version of Ruby. I had mentioned on stream that the... Is it an R package? I was waiting for this arch package to be updated and very generously, I believe it was Carl Smedstad here. I had a flag that this was out of date and now they have updated to have the current Ruby version. So I am thrilled. A wonderful little gift economy. All right, let's go run.

06:05We've got topics, we've got title. Sometimes I have things to do after the stream. There's one PR to review. Let's see. I peeked at it, so it's not going to have the nice blue marker on it.

...40So this is a pull request that we have looked at. I think once on stream already, but the gist of it is that the stats page pulls a lot of data from the database and aggregating that and formatting it into SVG. I think all the time is spent in queries, but I haven't tried to profile it was just taking too long. So.

07:13We are hopefully moving that into a, or I should say this contributor is hopefully moving that into a job. All right. Okay, let's get that running again. So I talked offline with this contributor about the brakeman warnings they got. Some design stuff. Let's see if this is ready to go. See, I like this. Now there's just one method that doesn't have a parameter. I wonder why GitHub formatted these differently.

08:08Strange. So then we have the stats graph job. And then we have, what are these keys?

...29These keys tell me that the contributor is not a heavy Ruby user because these are just symbols. Okay. So they have. Okay. So we have a fill method. All right. I see what's going on. So they've added like convenience methods for each of them. But honestly, this API of get cached graph fill graph cache is plenty. Joshka20 Hello!
Right, so we have one, okay. Let's, right. Oh, hey, Josh. Welcome back. So this one.

09:55Great. And now I can just say Yeah, I don't mean to be mean, but we could just dump all this code. I think that's the syntax. No, clearly not.

12:16That's a well-grounded Rubyist as Manning? Yeah. I bet it's here in my... Yeah, I bet it's in my history.

13:17I almost could say fail, should mention.

...54So we have the fills. And those are all the same. Do we want to keep this?

14:24Here we go. This one we can just don't need the intermediate variable. And let's say.

15:02So many quotes. Nevermind, let's just leave it out.

...31Where are these named?

...51Joshka20 I can barely hear you, maybe your mic is a bit low?
Oh, no, this is the utility method. All right.

...58Maybe my mic is a bit low. You know, I'm actually standing at my desk, so I'm back an extra foot, and I'm kind of muttering to myself. So, how do I sound now? I can boost the volume some more if needed, but... Or I could just, you know, remember what I'm actually doing and stand at a reasonable distance. Joshka20 np ;)
I appreciate the feedback. Thank you. All right. So these, these I can just collapse because I know what's going on there. And then cool. This is good. This is good. This is lovely. And then

16:55This will become, is there actually a benefit to making this an instance variable? I don't think so. Yeah, I don't think so at all.

17:52called get chart. Are they charts or graphs? I never remember the difference.

18:06Joshka20 Don't you use "service objects" or something like trailblazer operations to make your controllers thiner?
So we have get cached graph. So we don't have Trailblazer and We have one or two service objects in the code base, but not many, no. The lobsters code base is still very much in the fat models era of Rails styling. And it's fine-ish, like I gripe a lot about the models, but I'm griping about how ActiveRecord works mostly. GetCacheGraph, okay.

19:03I don't love that these repeat the word graph, whatever. You know what? These names will be clear enough and I can come back and change it later.

...23Yeah, there's something about the last, I don't know, what has it been? Six months or something of talking through all of my edits to the lobsters code base that's really made me want to not use rails much anymore i've been daydreaming about writing my own web framework

20:00Oh, did I write? I didn't make that forward reference, did I?

...28Well, that's... You know, I don't think I ever noticed that about the GitHub UI, but these comments appear in the order I left them. I thought they were going to appear in the order of that they were presented in the pull request diff. So here we're on stats controller line seven. And I thought I left another comment in StatsController. Oh, I guess they're all in Stats. But StatsController was above the stat object. Kind of interesting. Cool. All right, so this one, let's double check this. But I think this one is just a warning. Yeah.

22:10We're here.

...32Okay. So, yeah, so minor like nitpicky tweaking the verbs kind of stuff, but that pull request is almost ready to go. Oh, you know, there's a thing I was thinking about this morning. I didn't want to leave a comment because it's kind of a distraction, but I've been getting a bunch of maybe one email a week for the last three weeks. I want to say I've gotten three or four of these in the last month is the other way of putting it. emails from people who are saying they're very generic, but they claim to have found a vulnerability and they would like access to HackerOne. I don't actually know how HackerOne works that I would have to grant people access, but basically they're sticking their hand out for a bug bounty. And the first one I took very seriously, and then I was talking about it with the other mods and they were like, Oh no, this is spam. I got a ton of these. I don't know what it is that suddenly I'm getting a bunch. I assume there's just one spammer who has scraped my email from something. And now I'm going to be getting them under a hundred guises indefinitely. And it's annoying because I want to take them seriously. I don't know. Maybe that's worth a comment here because I could use advice. Hmm.

24:07Hmm. Jump over the issues. So a couple were reported. Oh, this is still open. Oh yeah. This one, maybe I'll fix this one on stream. Chambliss did figure out what it was. So that makes it pretty easy.

...42Yeah. Let me just let me try and punt. So I saw I've been trying to find advice on open source maintaining. prime_coder Hey @pushcx do u know a good rails / ruby guide to start
I had a conversation, I don't know, six weeks ago with Sumana. Brain Wayne is her username everywhere. And she suggested a couple of things. And I think from that, I found a talk where someone was like, yeah, I just write really detailed comments. I was like, for the level of detail, couldn't you just hack it out? And then I'm realizing, oh, actually, no, because there's always the like intermediate stuff like dealing with Breakman or adding another test or, or, or. And leaving a detailed comment means I'm more likely to start someone into being a contributor. So let me just leave a comment instead of just doing it myself.

26:31Hey, PrimeCoder. pushcx https://guides.rubyonrails.org/]
pushcx https://guides.rubyonrails.org/
The Ruby on Rails guides are where I recommend people now. Oop, typo. Make that clickable. So, huh, that's funny. prime_coder <3
On Twitch, I can delete other people's messages, but I can't delete mine. All right, well, don't click on the one with the typo. So the guides are are solid they're written for experienced developers. and There is a. Was it. prime_coder Noice iam a just gratuated software dev 8)
pushcx https://pragprog.com/titles/rai…
i'm trying to remember the cover of it no it's private product. Oh great we get junior developers in the stream occasionally so then. prime_coder Noice
If the guides don't click with you for whatever reason, I think this book, Agile Web Development with Rails 8 is the best available book. So it is in beta, but at this point it's feature complete and he's just working on like cleanups and minor editing stuff. There's the, what's the name of it? You're actually, so you have perfect timing to read this book. So there is a, Ruby Central is the, oh man, I should be putting these in my scratch notes. So Ruby Central is the organization, the nonprofit that maintains Rails and They have a slack, cannot manage my clipboard for beans. pushcx https://rubycentral.org/news/th…
So if we paste the link in the right place, copy paste, fight the Linux clipboard on every stream. So these folks I think are generally worth following if you're going to work in Ruby, but the neat thing is they have a slack. Where is it? Let me control F cause I'm not seeing it. Here we go. So midway down the page, it says, Hey, you can join our slack, right? And nobody needs more slacks generally, like broadly speaking, but let me pull it up off stream. Somebody, just somebody along, not just somebody, somebody neat. There is a book club starting. Can I bring this on stream? Yeah, I can bring this on stream. Let's collapse that. Okay, now I can bring it on stream. In the Community Social Random channel, Jim Remsick, who runs the Madison Ruby Conference and is involved with... You know, he's not the only person running Madison Ruby. Safe to call him the prime mover. You can be the prime coder, he can be the prime mover. But he's starting a book club, so to say, totally free, prime_coder noice noice thanks @pushcx
program to with other folks work through the book agile web development with real estate slack so it starts yesterday so you can jump in right now you have absolutely perfect timing i would strongly recommend this jim is good people ruby central are very good people

30:58This one. Yeah. So lucky timing there.

31:19Trying to think of a kind way to say this, this book Polish Ruby programming. It really needed an editor.

...33But if they are tagging him... Let me make sure I'm thinking of the right book here before I say this. Where's the... Yes. Wait, maybe I'm now.

32:24I'm thinking of a different book. Aren't I?

...35I'm thinking of a different book. Okay, let's just not leave that comment and be wrong in public.

...45There was another book I read that was published by, I want to say Pact, which is a mildly infamous technical publisher because they don't actually edit books. And so the books that come out of there are just all over the place in terms of quality and the one i just read god i don't remember the name which is i guess for the best was just really rough just disorganized and so So I'll put that in there.

33:55I'm just trying to build this up because I've learned that I never come back and fill these things in afterwards. So, ah, yes.

34:21I think we call the other ones refresh. So there are a couple of these methods in the code base now that, yeah, refresh things.

...50There should be, See?

35:37So hopefully that's enough of a path that somebody picks that up. So then otherwise, we had a couple of follow-on issues from the big CSS redesign. So let's take a look. So yeah, that's...

36:07Those are nice. I should probably look at this one about comment anchors.

...29I think this one I saw this email, so there is another web kit bug that, yeah, when, oh, that's super useful actually. I forgot that Firefox got rid of the JSON viewer. That's not useful. Come here. Can I just... Yeah. All right. So let's say...

38:45This is a.

39:43All right. And Chamla said that she's probably going to take a look like over the weekend or sometime next week. So I'm going to punt on this. And then let's see what else we had. Ah, so this one...

40:16I redesigned the uploader so that the

...34A tag. The

41:07Not margins. Padding, right? I don't know. Margin isn't clickable on elements. Padding is. Okay. Pick up. the vertical gap between the folder and here. You know, I honestly thought, so in 642, come here, I'm not grabbing these numbers. I fixed, I made that change, right? I'm getting this into the scratch. I replaced the arrow with Unicode. And previously it was this like very old school style of drawing shapes with CSS borders. And I am very surprised that replacing that border with Unicode got zero complaints. I thought someone was going to pipe up and say, I don't have a Unicode font that has this arrow. It's broken in my browser. And, you know, I was comfortable doing this because Unicode fonts have become pretty ubiquitous in the time the site has been live. But I wasn't, you know, 100% certain. So this was a little bit of an experiment. And it's really nice that in what has it been a week or so, that's plenty of time for someone to catch this if it was a bug yes we've had a week so that's nice you know nobody is posting the like missing unicode code point icon as a screenshot all right so we got two design things that i haven't looked at yet and that's all the issues so let's take a look we've got This is. This looks like when I was deleting the sub grid stuff. Firefox on Windows.

44:01This is. Yeah.

...17What's that?

45:12We deployed a different program in, what was that? All right, 1537 is probably going to link to it, right? Damn, it's always so hard to figure out connected history of this one. I merged a little pull request over the weekend where someone fixed a rendered bug. And then, all right, so let's say 1534.

46:35You know often look at slash threads. Few are down here. Oh it's the logged in view, so this is. Their threads so that's.

47:01Just gonna check that we don't see this on Linux. Oh, I do see this on Linux. Oh, that's weird as shit. Huh. Okay.

48:31Did I see something about guns here? Oh, this one. This article, I almost removed it because it's mostly a rant about capitalism, but it's sort of, at least it's primarily through programming. Yeah.

...59This is...

49:05This is a pretty good discussion about politics and violence, actually. Actually, you know what? I'm going to grab my personal browser where I'm actually logged in and leave that as a comment. Was there anything?

50:07I better read all the comments before I go say something, right? I don't want to get way out over my skis and. Yeah. All right.

...26So dark mode warning, my personal browser is in light, so we're about to snap over to white. There we go.

52:23I wonder if I mentioned them in the link.

...34Let me just go peek at that code. Cause the way I want to write this is to like link their usernames, but I don't remember if the mark downer. So it does post process all the nodes.

53:01if they exist oh but it wants to insert its own links right yeah

54:46This one.

55:17So I'm just going to link the one that my favorite was. Did qual leave us? Yeah, no.

...52What's the is-odd distinction, right?

56:33This one is maybe gonna drag into much bigger stuff.

...45Tempted to pull this one because it's like, hey, let's not just talk about this political topic. Let's drag in every hot button political topic. I'll keep an eye on it.

57:08So then we put this in the list of stuff we talked about. One of the things I've said a few times is that we tend to have more positive discussions, productive discussions, useful discussions when we start from specific technical things and then we broaden to understand why they happen that way rather than starting from here's my political philosophy and then let me use that to derive how we should handle these technical issues. There's something about starting from the bottom up that keeps us just a little bit more focused and a little bit less prone to flame wars, really. There's a lot of people with very different politics on the site. And we do a good job when people are like, hey, here's this thing, check it out, like Koala linked that resource, rather than it being, hey, let me evangelize my politics. I also think for folks with political opinions that they would like to see popularized, I also think that's much better rhetoric and much more likely to influence people than calling them dumb and immoral does. All right. So next issue is 1543. Let me just struggle with the clipboard, get that into the scratch. We're over here.

59:12That's, man, Mobile Safari. So it is real mad.

...30Wow. This is, well, definitely a design bug. Oh, did I tag that last one as a bug?

...57Hmm. Even the header is weird.

01:00:07Yeah, so this has got to be...

...16When was this left? Yesterday? Okay, so then this is definitely post... All right.

...59What did I just say that? No, stay on page. What did I just say that pull request was? 1534.

01:02:54I wonder whether it's a bug in WebKit's implementation or... See, the way these things move over, I expected with subgrid that the login would then be over this, because I thought that's how they were related. like this where they didn't get the mobile version that's so weird this is going to be like an ipad right where they like changed their font size a lot how else would they See these icons.

01:04:02I'm surprised how many storylines there are on the screen and then it didn't shift into mobile layout. I wonder if they zoomed out the page in some way that it shifted out of the mobile breakpoint.

...33So I'm going to leave these layout issues alone for a minute because I don't want to step on Chambliss's plan to look at the page in the next couple of days here. OK, what was going on with these comment anchors? So i've been streaming for an hour, so let me just do my little bumper that this is office hours for lobsters if you have any questions about the site of the code base, you can ask anytime and otherwise I work on the code base, you get to watch over my shoulder. and The schadenfreude of someone I don't like did a bad thing. That is such a high score for that story.

01:05:53Just to I wonder how they got that. Google stopped giving people search terms years ago. I'm curious how Toastal knows that. All right. So let's look at these comment anchors. Deep links to comments no longer work. And it doesn't scroll. Right. I saw this. I saw this once. So the anchor is getting defined twice. And then something about display contents is happening. I don't know display contents.

01:06:49Kind of block, inline block. Yeah. Box generation.

01:07:09Current limitations and some browser will remove from the accessibility tree any element with the display value of contents. But descendants will remain. This will cause the element itself to no longer be announced by screen reading technology.

...30So it's like, I wonder if it's actually removing the element from the DOM.

...44And this is why she did display contents was otherwise she'd have had to use subgrid.

...56Yeah, because grid works on direct children. And of course, you know, if something works on parent and children, everyone immediately wants it to work on grandkids or arbitrarily nested grandkids. It is... Yeah. And given the complexity of how long subgrid took to roll out, I kind of get why they waited. Yeah, no longer seems to exist, but... behaves as if it had been replaced by its contents. Yeah, okay. So

01:09:34No accessibility. God, have we broken the accessibility tree? So this is just a wrapper element. I'm trying to read this. It says, did we break every screen reader? I hope not. So it says it's fixed. We must not have.

01:10:05Right? The role. I don't think we had a role on that. No. Okay. So we almost broke the accessibility, but we didn't. All right.

...40Get the...

01:11:46so let's go this is 1531 okay so this is the comment folder and this is the div it has a short id if it's persisted has the IDC underscore. Where did that? Man, I dislike this way that we. Oh, here it is, yeah.

01:12:46Why did I add this?

...56I didn't. We've had it since 2014. What? What did someone think they were doing? Fix the Cancel button in the comment form.

01:13:16OK, well, I'll take a look at the comment form. Oh, you know, that reminds me. Someone mentioned to me in passing that comment previewing.

...32I'll take a look at that. All right. So.

...46Oh, wait a minute. So this version of this in 2014, no, that's comment box. That's the editing form. They moved this a name. We had two different IDs. We had C underscore and comment underscore. What happened? Why did this one change?

01:14:30Am I too hot? I'm on the wrong line. 2017. All right. So, you know, the way we do highlighting, we only want the one that's on the div. This other one is just wrong. So I'm going to delete the A, which I'm aware makes comments scrolling, does not fix comments scrolling, but all right.

01:15:24And the JavaScript has been completely rewritten since then. So let's go take a look at anything about cancel. So we find the dot comment. Yeah, so that's been dead code for a long time. All right.

...55Just see if the tests still pass. I wouldn't expect any to fail. We don't have a lot of front-end tests. But just to be thorough. And then I'm going to tinker with it locally. So let's get the Rails server started in a minute.

01:16:17OK. So that's fine. Rails is fine. Local host. Let's log in the local host where we are, have a test password and then sure. And this comment, I'll say reply cancel. All right. So yeah, that's totally fine. That looks, that's wrong. Okay. Let's just grab this.

01:17:11Jump back up to the other issues.

...20I guess this is also in, yeah.

...39So at least the preview isn't cut off. Let me just copy a bunch of text, make sure it's not a length thing. Yeah, so I'm getting the full preview. It's just bad layout. Okay. And then if I, let's reload this page.

01:18:12yeah i'm not getting because of the display contents it's not scrolling to this it's not highlighting this and what do i see if i remove the display contents

...47Yeah, see, this is the target that's supposed to be highlighting. Here we go. Woof. Yeah, so I can't just yellow that. We can fix the markup at least. It doesn't make anything worse. And it does have to get fixed at some point here.

01:19:20This is 1531.

...59Thank you.

01:20:25Okay, I better make sure I get this recording up so Chambliss can see it. We're hitting a bunch of stuff. On the other hand, she understands the CSS better than I do at this point, so she'll be able to catch up from these comments. No need to watch me puttering around the codebase for hours. Okay, so...

01:21:45I don't know safely if I broke something else.

...56Man, you can tell the cat woke me up early in the morning because I can't type for shit today.

01:22:27I already said it. Okay. Hmm.

...58I expected that they were going to be siblings and not one was a child of the other. I mean, you know, there's two or three intermediate level DOM elements because it was in the byline div. But the fact that it was nested that way gave me a lot of confidence that I could delete it as opposed to I thought it might be up in the thread template. But if they're both in the same template and one's a child of the other, then you know nobody is using the comment template in an odd way.

01:23:46All right. Okay.

...56Okay. So I'm going to leave these CSS issues alone. Okay. So I think that's all the regular check-in on issues and PRs.

01:24:33I'm ready. So usually I have been working on UI improvements for merge stories. pushcx https://github.com/lobsters/lob…
Let's see where we're at with that.

...51Let's put that in the notes.

01:25:24zipping through topics today all right oh time for the database refactor so if you have been closely following these stream archives i have i want to say i reorganized these a little bit and i added a little more message and

...59yeah i think we've done enough ui stuff and the ui stuff has been well received we got one bug report from someone who so where was it what was the topic let's just go find the issues there's a bug here and i can just find the link there

01:26:31What activity happened here that I haven't seen? OK. Something about a duplicate. There we go.

...55I was wondering if I should number these. story you know if this had a one two and then this had a one right here it's clear that there are multiple i feel like the merge icon is probably enough i don't want to count it out but if you didn't see it flash by the bug report was saying that there was sort of a rump headline an accidental partial headline And they thought it was a repeat, but it's a deliberate repeat. They just hadn't noticed that a second story was merged in there. I've got a sneeze. Hold on.

01:27:48So that minor bit of confusion aside, I didn't get any complaints about this change. And I got a few compliments. People seem to like it.

01:28:08I feel really pretty good about that. This is the kind of change that gets a bunch of attention. So I'm gonna step away one sec.

...28shutting the door for noise all right so i had wanted to do all this ui stuff so that i could fully inform wanting to do this database refactor so that there aren't two kinds of objects in the stories table there is like

...56a story that's a link, doesn't have a description on it. And then there is the top level story. And these two things act very differently. Like most of the time you interact with this top level story, you get dragged along this other story. You may not have the object. When we talk about the story comments, are we talking about the comments that are on this story? The comments are on all merge stories. we and it gets worse when you look at one of the stories that got merged in because then when you say we're talking about that story's comments oh do we go up to the top level story and include those do we go back down to sibling merge stories and include those and this all is just hard to talk about because we only have the word story for these two different concepts And so the question has been whether to Well, the certain thing to do has been to refactor the database so that these two kinds of things are separate. And the open question has been, are we going from stories to headline and stories or stories too. And I never had a name here. I was thinking posts. Links is already taken for some internal stuff. Post is actually pretty good. People talk about them informally as posts. Another obvious one is submission because Just, it is programmer UI, but when you're logged in, you see here the link submit story. I hate submit as a verb, but that's okay. At least it's not on the button. Wait, is it on the button? Come here, local host.

01:31:29Yeah, so it's submit there. Maybe it is submit. Don't love that.

...43This shouldn't be indented. Is that just because my... See, it's okay here. Maybe it should be indented. I don't know.

01:32:01This form has not been reworked into being the labeled grid yet. That's why it gets all pucky as soon as it's not a full width in the browser. We'll get it. We'll get it.

...30So big question of which direction to refactor has been foreign keys.

...44So comments points to story.

...58Who else? Hidden stories.

01:33:11Links. I think there's saved stories as well. Moderations.

...26Saved stories, yeah. Is that it? Stories itself, we know about that one.

...46All right, the suggestions.

...56List them. Tags.

01:34:06There's the end of it. All right. And I guess I have been leaning towards something like keep stories as the top level object and make posts the lower level object, but saved stories I think save stories, I don't have a strong preference on whether it's the top level whole thing or the bottom. I think probably it has to be the top, but hidden definitely wants to be the top level one because we've had bugs already where if you hide a story that gets merged into something, comments wouldn't disappear correctly. Or if you hide a parent, you would still see the thing that was merged into and it would link you into a thing you would hidden so those definitely have to go to the top level. yeah so.

01:35:38And I think I'm okay with the UI still saying story. I'm trying to think of what's the least breaking change here. So the option is like, are we breaking UI around saving and hiding stories? by calling the top thing or right and of the two the second one is much worse. Everybody has called them stories and uses the word interchangeably and... I think I would rather say a headline has many stories and change those two tables than say that a story has many posts

01:37:14hmm yeah and i think also it's kind of a i like that headline has a natural hierarchy because some of these are we've talked about that if A story can change which one is the featured link which one is the headline link that feels very natural to talk about where the hierarchy is implicit in the term headline because everybody knows it's the thing that comes at the top. Rather than oh there's a bunch of posts and which one is the story can change occasionally that's that's not clear to me at all. So I think it's got to be the former. Yeah, that we go to headline and stories. OK. All right. That's got to be it. Yeah. Let's start the refactor.

01:38:38This is going to be on a branch. Absolutely going to be on a branch. Never remember this. If it's BC or CB, no. Ah, git.

01:39:12It's been so long since I've actually said create table in a migration.

...59Now I guess a question is whether i want to copy the title and link or refer to it i think we can leave it normalized lobsters does not have like reddit level performance issues so What do I call it? Do I call it the top story?

01:40:43The headline story? I think that's pretty good. I have to add this and make these things nullable, aren't I?

01:41:05there is no safe default for that okay so one thing we're getting into is also these things are going to need to have short ids and i don't love the short id code the way it does a I mean, basically a spin lock to generate them and.

...43Yeah. So I saw someone created this library that makes.

01:42:02String IDs. that have 128 bits of entropy and are sortable. And it sort of looks like a Stripe ID. I mean, it looks a lot like a Stripe ID. If anyone from Stripe is watching, please write up a canonical blog post about Stripe IDs. You have interesting stuff in there. It would be excellent pillar content to use the old content marketing term. I would link to it on lobsters.

...53And I'm just saying that because I know they have thought about type IDs quite a lot. So let's figure out where we're going to add this. It's not really a database. It's not a job. It's kind of a Rails thing.

01:43:14I guess if type store can be in here. Let's tidy this. As long as I'm here. And I know it has a Ruby gem. I poked at this. So it's called typeid-ruby.

...45Well, the repo is named typeid-ruby. OK.

01:44:05It'll automatically get required by Rails. And then I can say type id.new. All right. So in a lot of places, if we look at this URL, it just has s slash and then six hex. Well, it's not hex. It's base 36, but it has six characters. And that is the short ID and all over the place, then things have to know how to turn a short ID into say a CSS ID, where one of the nice things about these type IDs is it can be used in both contexts.

...59So I'm also gonna say

01:45:13I never remember this interface.

...21I can't ever remember. Is the type the second thing, or is the name? And I'm going to call it typeId, I guess. So if I said story.typeId, I want to call these slugs. I don't know if anybody else thinks of them as slugs, but I do.

...56And again, there's no default, and I want null false.

01:46:11What is it? change column.

...47What's that?

...56I guess it could be reversible. Just rarely seems worth it. Drop column stories slug. Then we're going to have it on comments. And we're going to drop table headlines. You know what? This is not worth writing.

01:47:26Because then I'm going to have to, like, rename foreign keys. There's just so many parts to this. There's no going back. We roll forward. We ride or die. Stories, comments. With tag and category, I'm fine. using those things they have url safe identifiers that are unique like so on tag it's the tag on category it's the name on user it's the username i guess on user it's not because those aren't stable let's add it to user

01:48:27OK, so I don't like splitting these up, actually.

...55Find each. I need to remember what these update attribute is the one. Let's get zeal.

01:49:35I want the one that bypasses validations and callbacks.

...44That's not this one. Also see update column.

...56No validations, no callbacks, doesn't touch updated Yes, that's what I want.

01:50:26And it is a little tempting, especially when I have three of them, to create a bit of metaprogramming here. What if I call?

...55with a symbol okay i still get good but i don't like being too clever in migrations and for code that i'm going to run once and then not maintain because we should not maintain migrations

01:51:54Got to do it for what we don't have to do, actually, because there won't be any data in this database yet or any rows in this table yet.

01:52:20And then we can change column. Headlines, top headline store. Yeah, I like that less since I'm having to type it again. I'm going to have to, I don't have to change it because again, there's not going to be anything in here. OK, so what do I want to do? Create a headline for every story. Update all stories to going to headline.

01:53:27Right, I think that's everything I gotta do. Don't need this anymore.

...44I'm going to have to make a default for each of these.

01:54:16So I want a method that I can call from all of these records that's going to set up a type ID named slug, scoped to the table that makes it readable but not writable, not rewritable. So at the class level, I want to call, we'll call it has slug. And then we will say, so I want to, basically I want to have my own hook. How do I want to do that? Because what I want to call is, all of these things need indexes. Is it add index? Yeah.

01:55:35do i need an index on the headline story id i don't think so because i'm not going to look up headlines by their top story call it the top story i keep doing that or i could call it the head if i want to be journalistic about it i don't know having this named headline story just irks me because it's a repeating the table's name

01:56:35So what is its actual relationship? It's not just that it's the top. It's from the perspective of the headline, this is like the primary, the lead. Lead isn't bad. Where's my thesaurus? So I am now reaching for one of my favorite programming tools.

01:57:03I don't have it.

...17Where's my beautiful orange book? Not a good search.

...36I guess it's this and they just don't have the cover image. How strange. So one of my best programming tools is a thousand page thesaurus.

...59And you can't see it, but you can hear it. So what we want is This is how I name things, because if a name doesn't immediately come to it. All right, so let's go look for concept of primacy. Elemental P. Primacy. And I strongly want this to be. A print book it's not useful if it's a PDF because you can't browse and skim in the same way. So we got basic front nice we want front or chief to 16.

01:58:55And, by the way, this is the best available thesaurus. So front is, oh, okay, like it's the forward part. All right, no, we're not talking about a physical relationship. We're talking about being most important. So that was, I guess, chief. Or it's first. What's in 818? So that's going to be probably the notion of things in a linear order. Yeah, it's not that. So we're ruling things out. And that's one of the reasons that primary is not what I want to use because it's like, oh, it could be the direction. It could be the sequence. It could be the color. It could be... There are a bunch of sections here. We have original. Oh, paramount. Okay, so we're going to want chief or paramount probably. So let's look at 249. I'm sure this is very thrilling viewing, but... This is how we get good names. So superiority, state of quality. Superiority, preeminence, greatness, lead, transcendence, ascendant, prestige, favor. I want the, where are my adjectives? Superior, greater, better, finer. Yeah, I'm not actually trying to say that it is the best. Capping, topping, that's not bad. But these are all, they're a little too quality oriented. And a lot of the times our headline story, just to reuse the term, is just happens to be first. And then other people are responding to it. And sometimes, so like when there's a spicy blog post and it gets three response posts in six hours, very often one of those responses will be much higher quality so i don't want to imply that it's better 2 49 14. 997 24 what do we got

02:01:28important consequential significant bigwig of importance notable noteworthy weighty emphatic urgent no no no oh here we go leading foremost main chief number one premier prime primary supreme capital controlling overruling overriding all absorbing these are way too exciting what was under chief main principal paramount paramount foremost headmost headmost is a little punny but nice leading dominant leading that kind of implies it's a race arch banner banner is good Magisterial, primal, first, prime, focal, central. Hmm. Main is not bad because it kind of riffs on the common branch name. Principal. I like principal a lot. First among equals. name things like animal farm foremost headmost leading dominant crowning capital cardinal great arch banner master magisterial what if we just said what if i look up select it see this is everything riffing off of primary and i'm just not I feel like I'm not getting what I want.

02:03:33If I look for like highlighted, how about highlight? H-I highlight. Featured? Could be featured. A lot of the times when I use my thesaurus, I go through like six alternatives and I like explain why I hate them all. And then it clicks with me what I actually am trying to say. So highlight. We got feature. Yeah, 997.7. You could follow along at home. 997.7.

02:04:29feature highlight high spot main attraction centerpiece outstanding feature best part cream selling point maybe let's just go with feature the headline features that story i like that oh see you know what later in there so now i'm at what is this 997.15 as the verb there's feature headline star give top billing to that's what i'm saying is give top billing to star yeah we'll go feature matches on the verb oh programming what a thrill a minute career

02:05:34Let's go with featured.

...42So it references the domain. What does it? Know that the foreign key, yeah.

02:06:07trying to remember how I specify that it's right, like that, that this table is

...44say references oh i've just tied it in a knot haven't i so if every story has to have a headline and it really does for sanity's sake every headline has to have a story to reference

02:07:35Where did the eagle go? So what I'm not seeing is how to name the table. So there's a remove reference.

02:08:17The reference column type is bigint index defaults to true. Oh, okay. That's nice. Foreign key to underscore table. There we are.

...45So now this is ugly. So how do I break this little Gordian knot? Especially if I can't trust Rails to have a deferred constraint, basically.

02:09:15Also, comments have a short ID. Hats have a short ID. OK, so they're going to need to get this treatment.

...48Hidden stories. No. Messages. Man, I'm not remembering these things. All right. This is getting ridiculous. Now I'm gonna metaprogram. Now that there's like nine of these, fine. So stories, comments, users, hats.

02:10:20Messages. What else? Did I loop? I looped. OK. What is the, I guess I'll loop the models. Yeah.

02:11:24It's a little tempting. No, I can't make invalid type IDs. It's a little tempting to say, like, oh, every story, take its six-digit code and shove into type ID like story underscore its short ID. But that would not be a valid type ID. And that feels like it's just making trouble to use the format but not really use it. So I'll bind each.

02:12:01What's the inflector?

...13Camelize? No. Deconstantize?

...32Humanize? No. Parameterize. Yeah, I think that's it. I mean, I could go through the interface properly, but no, then I get plural. So if I said story.class.toS, would I get the name? No. Story.

02:14:07How do I ask a story what its table is? OK.

...54It seems good. I feel like I'm going to want type IDs on other models, and I'm just not thinking of what they are. See, it's real tempting to add them to category and tag as long as I'm here, right? Domain, like these things are named by their name. So are users though. All right. So let's say all of this stuff, category tag, gotta sort this nonsense.

02:15:45All right. So category comment domain. Hat request, yeah, I build IDs for those. Hidden story, no, that's just a record. Invitation, which... God, if invitations had a short ID, it would replace, yeah.

02:16:23doing this i feel like i'm exposing a bunch of places where we've had minor leakages of table ids i'm sure there's like a clever a wasp name for it but we never linked to those mod notes are internal but it would be handy origin you know you can't actually see a hidden story yeah because the user has to create and delete them Didn't really think about it till save story. Which I was going to change to headline, but I would rather do it in two passes.

02:17:39Yeah. Suggested tagging title, those I'm going to get rid of. Tag, filter, tagging, user, vote. Man, vote, that would be a little sad. Four million records. Actually, wait.

02:18:04Yeah, ballpark, four million. Not as many as I thought.

...19Do I want to put moderation in there? Little bit.

...35All right.

...48chamlis_ hi-ho
chamlis_ standardising short IDs?
oh hey chanelists i was thinking of you a bunch at the beginning of the stream yes yes i am because as long as i'm adding it started from headline i'm working on the story merging ui and i realized i was going to link to them and so i was just like all right let's Let's do something a little more repeatable than our short ID code that's copied and pasted a bunch of places. pushcx https://github.com/broothie/typ…
And this type ID project, I think pretty highly of it. With the, the dream that I wish Stripe would write a canonical blog post about its API identifiers. Until then I'll use what I can.

02:19:48prime_coder Iam back @pushcx i love the guides u showed me
all right so oh hey prime coder welcome back i i hope they're useful the prime_coder ye the Getting Started with Rails is rly good
The default Rails guides just recently with Rails 8 got a big update and they got nicer UI, nicer styling. Great. And like I said, if you get stuck on that, move on to that book. prime_coder ok
You might want to, if you think you'd like more structure learning Rails, do join that book club. Okay. I find structure helps a lot when I'm learning a project. Like either I have to have a personal project to hack on of, oh, I need to make a video game. Then I'll learn Lua. Or I have to have a group. It helps so much to have one of those two things.

02:21:04So Chambliss, now that you dropped in, you can keep looking at this or I've left a bunch of comments on bugs related to the layout changes. prime_coder True 100% atm iam also learning this week django for a software developer role 8) django has also a kinf of mvc
There's a couple of wild screenshots in there if you haven't seen it, but if there is anything in there that you think you'd like to talk through or kick around as an idea, I am very happy to spend some time doing that now. Otherwise, I'm going to keep working on story merging. Hey, Django. Yeah, Django and Rails are so similar. I worked in Django professionally for a few years, and I actually inherited two codebases in Django from one of the Django creators, Adrian Holovaty. chamlis_ ahh, thanks. I have a very full mutt inbox here, I'll take a quick look through them
So I was kind of joking about following him around. It's a really nice code base. I haven't written Python for years, but it's nice. prime_coder <3 <3
I shifted to NeoMUT maybe a year or two ago. I like it a bunch. I don't remember what the incident was, but there was something like I wanted a plugin or I wanted some customization and NeoMUT had it and regular MUT didn't. It was a pretty painless migration, actually.

02:22:40So.

02:23:06chamlis_ I think I ran neomutt on my current config and the colours were wrong or something so I gave up, I'll give it another look
Yeah, I don't know what could have changed there. I didn't think there were styling changes. I couldn't tell you. So feature, it'll be S, and then I'll have to finish that bit in application record. Yeah, I had that open, but I lost it.

...39Should only need that. Now let's actually copy timestamps over.

02:24:07That seems fine.

...16And then once I have that, then I can go through all the stories again because I don't need to go twice. Let's do the opposite. Not where, right? I think that's the right. way around yeah it's a prepend story i'll let story account start up where merge story id is nil and then not where no

02:25:20chamlis_ on the iOS 15 bug it's because that version doesn't support subgrid at all. I was definitely overly optimistic in thinking anyone who ran a contemporary browser would be running a recent version
Oh, it didn't occur to me that there were old versions of iOS running around. Could you leave that as a comment? Cause it escaped me that it was old versions of iOS. I remember seeing on, can I use that? It was fairly recent, like two years or something, but that's interesting. Thank you.

...51What the heck is the not? .where.not, that's what it is. I could just vaguely remember there was something clever about this API. There we go, okay.

02:26:27How do I dereference this? I guess I want to say I want to follow the merge target.

...54Oh my god, read line.

02:27:04So I got a story. I didn't get that preload, did I?

...16I knew this.

...33merged into story. I can never remember these. There we go. That's what I wanted.

02:28:19And then this one.

...25So we only have to walk the table once.

...33God, you know, I was really wondering why that nav got funny. You explained it.

...53Alright, that looks correct.

02:29:39chamlis_ I also hadn't realised just how modern :has is, a side effect of not doing much frontend stuff I'm sure. so I'll look to be removing that as well as subgrid
Kind of want a progress graph if I'm inserting 100,000 records into the database. That's OK.

02:30:22This looks pretty good. Where did I add the? Yeah, and then here's where I got to tie myself up in knots, right?

...56I'm trying to remember this Rails API.

02:31:30chamlis_ the issue with /threads is very strange, the comments jump out of #inside altogether, so presumably we're closing the wrong tag somewhere and the browser is doing the best it can
is has that modern i thought it was safe conservatively safe where are we you're looking at mobile safari for that so it was introduced ah oh that's really interesting We must have an extra end. Well, we can all just wait for Herb Linter, that new tool that's coming along then. chamlis_ oh I was going off of the MDN "baseline" for :has which lists it as 2023
Has has been supported for baseline 2023 means what? OK. See, all of these are two years old. So where is it getting? Actually, all of these are three years old. Ah, Firefox was a year after them. Actually, almost two. Call it a year and a half. All right, so I don't think you need to remove has. We've used it elsewhere in the code base, right?

02:33:11Oh, hey look, there's even a comment about me wanting has. That's gotta be a couple years old. chamlis_ somebody in IRC was running qutebrowser which was derived from chromium 88
And then we have the folder uses has.

...33Chromium 88, that's how old? Snetrz isn't chrome 88 like, 4 years old?
I'm so I didn't see that report about cute browser welcome sned rz snorts I don't know snort yeah chamlis_ it gets some kind of security patches via kde, I think
I think I'm OK breaking Qt Browser to get colon has because we've used it in so many things and want to use it in several things. So how can I use define baseline? Oh, this is nice.

02:34:40chamlis_ that's only the qt5 webkit, the qt6 is more recent (but was less performant for that user)
Newly available, widely available. Okay. All right. So when it's 30 months, it becomes widely available. So that, that can't be long, right? Come here. So Firefox added it in. Wait, hang on.

02:35:13I'm not going to count. I have a computer to count. So 30 months ago is October of 22. And Firefox says May of 22. Which one of you is holding us up? August. Come here. August. Snetrz you can use the date relative view btw
March of 22. So that's fine. December of 23. Okay. So if we said that, aha. Oh, well that would have saved me some looking. Thank you.

02:36:03So then 2023, 2022, 10.

...16I'm trying to find a principle to justify the thing I want to do, which I admit is the definition of unprincipled behavior. But I would like to say that we use things that are widely available. But I also really just want to use has, because it fixes such a ton of stuff. But I guess it's not there yet.

...52chamlis_ in my head firefox is less likely to be out-of-date
Is it possible to add...

02:37:04chamlis_ with safari you could have an old phone stuck on old safari
I'm wondering if I can add Qt Browser to this. No, QQ is not the same as Qt. All right. Yeah, and we had with old Safari we had somebody report an issue because they had an ipad that was like eight years old and we did something that looked funny in their browser and i was like buddy i can't help you maybe it was even a tls issue at that point december 23. so when will that be I guess a year and two months. Right. So if I said 18 months ago, 20 months ago. Oh my God. Read line.

02:38:31Write and read line all day. Okay, so I will have to wait 14 months to call has widely supported or widely available according to the can I use definition. I still don't want to give it up.

02:39:33chamlis_ if we accept that safari is the only browser you can be stuck on an old version of, then maybe we should allow things supported by safari 30 months ago, and everything else now?
I don't have a great answer there.

...45Ooh, there's a clever way to thread the needle. And honestly, it really is just has. The other exception I would make is baseline, widely supported, widely available, or it's colon has. Because then I'm being honest about what I'm doing. Because if I am saying it's just you can get stuck on old Safari, and worse, it's old mobile Safari, right? Because... Yeah, I think you can... I guess you could get stuck on old desktop versions to i've actually supported a family member who ran a MAC os desktop and eventually they couldn't install the latest versions of chrome anymore. Because they just didn't go back that many operating systems and MAC os abandoned the hardware.

02:40:54chamlis_ blimey
yeah i'm gonna. So let's

02:41:57gj1118 Operator Mono looks so nice on stream. I paid 200 bucks for it and it does not look half as nice :D ..
It looks better on stream. I don't know what to tell you. I only use, it's worth mentioning, I only use Operator Mono for the cursive, which is their, they call it Sans Italic. The rest of this is Inconsolata, and that's a free open source font.

02:42:52gj1118 mind sharing your dotfiles , if i may ask please ..
Chambliss, how does that look?

...58My dot files? You gotta be more specific. pushcx https://gist.github.com/pushcx/…
I put, if you go to, I mean, I'll just find the link that fast. chamlis_ that works for me
So my vim color scheme is here, but the rest of them gj1118 I was specifically interested how you are conditionally setting the italics
take a lot of time and energy to clean up and so like I don't have my vimrc and other stuff anywhere I could probably share the the alacrity one if that helps let's take a look at that real quick yeah that's fine so here where's Let me just grab this and. Edit. And file.

02:44:13Then.

...22what is it xb no pb copy i think that does it now can i just paste there we go all right so oh well i got it there that's what you were looking for so gj the Here in Alacrity, I've configured it so that when it's italic, it switches over to this other font. gj1118 Thank you so much Sir.
And I sure didn't remember that I'm using light italic. And then for bold, I use the regular. Well, there you go. This is me testing the font. Looks a little nicer in terminal, right?

02:45:31yeah that's just me testing it all right well that that should do you all right a lot of styling things today all right so load series doesn't tell why it's not standard i'm gonna say i this is just me yellowing things all right let's What is happening in this terminal? Did I suspend something?

02:46:18It's something to it. One broken terminal.

...35And I know I'm on a branch for the eagle eyed I will either rebase that off or just leave it because it's not urgent. So here. tying myself up in knots.

02:47:41These don't need comments because they'll get the little headline out of the default migration stuff. It's only when you do a loop to fix data that Rails doesn't print anything, which is fine. That's totally understandable. So create the headlines. We link the merge stories to the headlines.

02:48:12This is going to be broken. This is just going to be broken because I want two tables to both have not nulls. As long as it happens in a transaction, we'll see if we can get there.

...39Let's Do I want to.

...55I think I want to break this up. Because I can do the table creation now, I still need the yeah. Keep this on the branch.

02:49:42Thank you.

02:50:08I usually do this block style, but I don't want people invoking this. So in the context, I got to do this terminal. class 2s parameterize yes

02:51:15Oh, and you know, CX, pages, screen, index. Let's update the fact for what JG pointed out. Sans mono, light italic. There we go.

...42There's a missing word for you. Alright, that'll get deployed next time I push a blog post or stream archive so probably later today. Put that in the topics.

02:52:18Why did I close that? All right. So before validation, set the slug if we don't have one. And then how do I make the column read only?

02:53:05gj1118 ooh, I just applied those changes on ghostty, and its looking fantastic Sir.. Finally can tell the wife that $200 + tax were well spent !! :)
I'm glad you got it looking the way you like. And if you didn't see because you were tabbed away, I also put that into the FAQ. So thank you for helping me improve the FAQ. I didn't realize I was doing something a little different.

...33I think that's all I need.

02:54:08I'm doing disconnected work in these. And this needs to be above, right? No, because this commit is going to add the slug, so that's fine. All right.

...36I kind of want to tease this part into its own commit.

...48Yeah, I really do. I'm going to be mad at myself looking at that git history when I come fix a bug. All right. I'm going to do this. I'll rewrite commits. That's easy, right? So we'll just call this whip. jump over to master let's grab this one to grab that commit and let's make our own migration

02:55:40And it's just easier to do it here in the BIM and pick it apart with Git. So whoa, whoa, whoa. Don't yell at me, Git. I know what I'm doing. I'm allowed to edit files that don't exist. So for all of these tables, we'll do this and Add that back and add that. Yeah. So they all have a read-only slug, but we're going to bypass that for this. I think I can update column there.

02:56:46Or I can just make it read only in the next commit. Let's see if we get an error.

...55We get a different, oh, I didn't add it to the gem file. So that was this.

02:57:09And bundle to update the lock.

...19OK, good. New error. chamlis_ think I tracked down the /threads issue as another expression of #1524 - a deleted comment is missing from the threads pages and messing up the depths so it underflows
Why would you want to add slug to categories? Oh, it doesn't run migrations in a transaction.

...44Oh, ho.

...51That could certainly be an issue. That's really interesting. Although I don't... Have I deleted? Hmm. Hmm. Yeah, okay. chamlis_ I had a branch somewhere that did the deleted filtering just on the user's comments and included all their parents
That makes a lot of sense. I thought... I thought deleted comments always get a tombstone, which is like a... a comment rendered that just says a comment was deleted with no controls. And if you're logged in, you can see the mod message. But it's been a minute. Why am I here?

02:58:52And no wonder I didn't see this bug, I'm always logged in as a mod. And we see deleted messages.

02:59:05Huh. I actually heard my desktop fan turn up a little to run this.

...21chamlis_ user_threads uses the accessible_to_user scope which filters them entirely, iiuc
Ah, that would do it. Look at that. Look at those lovely IDs.

...40We're going to see a lot of whatever this value is because that's the timestamp. But that's fine.

...53Rewriting big tables takes a while. Actually, I'm making a mistake. aren't i because it's gonna it's gonna rewrite the table multiple times all right hang on let's back that out so let's drop it from categories and then comments but it shouldn't be done there should it oh it probably added the column and it didn't finish the migration because it's got to walk all however many comments, what, half a million, 600K? All right.

03:00:39What's the, I know I've done it.

03:01:07There we go. Change table. I don't know if I'm allowed to do arbitrary code in the middle there, but we'll see.

...53might be valid syntax even yeah i want zeal where's my docs and you know the reason it does that accessible to user is probably so that we see a consistent number of comments per page. But if we're going to show people a tombstone, search should still use accessible to user.

03:02:43I have to rewrite the table before I can do that inner part, don't I?

...53OK. There's so many ways to do things in Rails.

03:03:04So then it becomes t.change.

...13And then how do I add an index?

...26chamlis_ I defer to your experience with the site here, but could you manually increment and decrement the depth in _threads, rather than trust the comment's depth?
There's remove index.

...41It used to manually increment in the depth and decrement the depth in threads like you're describing. And I didn't trust it. I think, so we have two presentations of comments. There's the threaded kind, and then there's the flat kind. And you're talking about threads, threaded. Search and slash comments are the flat style, but they're the only two places they're flat. I think the flat style should continue using accessible to user to just hide those comments because it would be weird and bad to search for a comment, search for text and find comments that were deleted and tell you what was in them. It would also be a leakage. You could then brute force the search engine to recreate those comments. And then I think on thread, we could assume that you get it and update threads so that if the comment is not accessible to the user, it prints a div with the class comment and the right short ID, you know, the short URL, and then just goes ahead and prints either this comment was deleted by the author, deleted by a moderator, and if they're logged in, show the moderation reason. I think that would work.

03:06:07chamlis_ should that include deleted comments (and their parents) from the user whose threads you're looking through, or just deleted related comments?
Accidentally.

...44I'm not sure I follow the question from the user who's... I think all because otherwise we're going to break the page. So if we have Alice that gets a reply from Bob that gets a reply from Carol and we delete Bob's comment and we're looking at Alice's page, we have to show chamlis_ if you look at ~chamlis/threads and I've deleted a deeply nested reply, should any of that thread show up?
comment was deleted tombstone or the page layout breaks when we get to carol's comment oh i see what you're saying right so reverse it and we're looking at bob in my example

03:07:37I would say no, we should not include Bob's comments.

...47I guess I'm not super confident because I've thought a lot about how we how and when things get deleted from the site.

03:08:07I don't think I know what the current behavior is. My default answer is don't change the current behavior.

...59I thought about this when I added accessible to user. I did not think about this when I added accessible to user. This is a fairly recent change. By lobster standards, you know, it's only a year and a half old.

03:09:27Yeah, that's a That's an accidental change, and I think we should put it back. So if you are looking at chamless threads, yes, we should render a tombstone comment.

...53God, I broke a bunch of stuff when I did this, and I didn't even think about it. Hmm.

03:10:54chamlis_ it's funny how "it's just a DAG" but there's so many edge-cases to consider
chamlis_ s/DAG/tree
Yeah. Yeah. All right. Given that we expected to. Why doesn't change table want this?

03:11:24Options hash.

...41It's thinking of the block as an argument, isn't it?

03:12:00So I've gone past my usual three-hour run. I'm going to get this migration sorted out and then probably roll out of here.

...25Oh, fuck it. It's still in migration. It's only going to run once. Let it run long. Just do it the simple way that works instead of the clever way that saves time but loses it by not actually working.

...53Yeah, so for this, So if it's 12 seconds to edit comments, then it's going to have to run through all the comment records. So I can peek at it, can't I?

03:13:40Oh, those filled in. I guess changing it to be not null is longer than adding it. Well, we'll see.

03:14:13One reason for moving to type ID is we are seeing increasing collisions in short ID. There's a log warning when it tries to generate an ID it already has. But one way to see it is this sort of invalid query where, and start from stories. What is this? 130K, 113K. From comments, 571k however now this is sort of invalid because the two columns are separate namespaces But we have generated the same short ID 58 times. That's actually up from the last time I ran this query. The last time I ran this query was maybe a year ago. And I want to say we only had a few. So what if I said, select stories created at comments created at. Order by 1, 2. I must be misremembering because these have, wait, let's sort by 2, 1. Shouldn't there be more? Yeah, there's more collisions in comment. Not that that statement really makes sense. But yeah. So if we're getting to the point now where every, I feel like I need that meme from Pacific Rim. By this time next year, we could see a double event Because this pace is clearly accelerating where, okay, yeah, sure. These two happened within three days of each other. That's a stochastic process, but typically they're like two or three months apart. This one's four. And then you look down here and it's like, oh, wait a minute. Now we're down to three weeks ish. So it's becoming closer and closer because both our traffic is up over time. And there are more records in the database to duplicate. Yeah, the first one showed up two years into the site. So better to do this kind of breaking change now than wait forever. There's the code in short ID, actually. It's fine. It works. I don't argue too much with code that works. The way it generates is it just loops 10 times to generate IDs. We just say, are there any records with that short ID already? Not super thread safe. I mean, as long as everything runs in a transaction, that's safe. becomes dangerous unique i didn't say unique didn't i that's fine this is just development even if this has been running for five minutes it's just development it can run for an hour it doesn't hurt anything all right and let's double check that though add index Unique true. Yep, I remember. Good. All right.

03:18:58Could do this in the other order. Just seemed to make more sense to set null false first. All right.

03:19:14So I'm going to... run this migration off stream because it's clearly going to run for hours and i want to see the exact thing run if it's going to take hours to run and maybe i will deploy that i don't know this weekend

...46Huh, almost exactly the same time.

...57How did that? All right. For this one, I have to go through all these models. So that's dead. I have to go through all these models and add the head slug call.

03:20:27I think that add a read only is going to mess me up.

...45Assigning a new value. Does replacing a nil count as a new value?

03:21:19If it's not a new record, yes, that includes replacing a nil. All right. So then that's gotta be a second commit.

03:22:02So I'll get that added. And then later I'll think about replacing our use of short ID. But that'll be a little bit of a project. It'll be a whole hell of a lot of redirects. Actually, I suppose we can never drop the short ID columns. Yeah. So this will want to have

...56That code clearly didn't care if the column actually existed on the destination table or not. So, all right. I'm turning off the production banner about office hours. I think that's all I got. Yeah, it's been good actually. chamlis_ thanks for the stream!
There's been real good nudging along the design issues. and then starting to introduce this typed ID that's fixing a bunch of things. Well, thanks for dropping by, Shamos. Have you left any comments here? Yes, since I was just here. I figure I should look at them while they're still in my head.

03:23:52Well, that's really thoughtful, your comment.

03:25:43Thank you.

03:27:04All right. And what's over here in stats?

...56I'm going to look forward to merging that PR. All right. Well, thanks very much, folks who hung out. Oh, do we want to try the RAID thing? I forgot it last stream, but I got that RAID browser. Let's see if there's anybody else who's doing development. Ooh, someone who's developing a language. That's pretty great. Let's send everybody over there. Otherwise, this is going to be the end of the Lobster's Office Hours stream. Thanks for hanging out with me and take care. Okay. So how do I, ah, there we go. Oh, I can't actually chat here. Cause it's verified accounts only. Well, I guess I'm not going to read that person then anybody say rates. No, let's users. How about tags?

03:29:04Lost the raid browser. Oh, React. Somebody's got to be streaming Ruby, right? No, these are, I guess I'm the only person who was streaming Ruby. At least it tagged it.

...40gtfrvz given the platform most people are streaming gamedev
Well, this one looks like it's probably web development. We are going to go with this one.

...50There we go. Bye, folks.

03:30:05Look at that.

...11pushcx The raid has been canceled.
Huh. There's actually something really weird in that channel rules. I'm going to just cancel that. I'm just going to call it. That's too weird and complicated. Yeah, I'm going to hit stop streaming. Take care, folks.