Let's just break master again, it's what the GitHub UI wants me to do

Streamed

Merged PR #1457 for prefers-color-scheme support, but it broke production with a type mismatch. Fixed a 500 error caused by the CSS contrast setting being stored as a string instead of a boolean. Discussed SQLite vs PostgreSQL for Lobsters, weighing pros and cons of each. Fought with Scenic views breaking migrations due to multiple database support issues. Created a migration to materialize comment depth and reply counts, with several iterations to get it right. Complained about GitHub’s UI for draft PRs and how it leads to confusion about PR readiness.

scratch


topics
  prefers-color-scheme https://github.com/lobsters/lobsters/pull/1457
  sqlite vs postgres https://github.com/lobsters/lobsters/issues/539
  scenic breaking more things https://github.com/lobsters/lobsters/issues/1458
  story merging https://github.com/lobsters/lobsters/issues/1456


sqlite vs postgres
  same:
    support our featureset
    almost surely support our performance needs
    ~infinite scaling (for our needs and growth curve)

  in favor of sqlite:
    one fewer VPS
    maybe nicer for Peter's daydream of Lobsters as a service (4d119cec)

  in favor of postgres:
    so many features
    stricter about types and schema


title
  Let's just break master again, it's what the GitHub UI wants me to do

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



03:41Just getting started here. Let's put the stream up. Thanks for joining me, folks. So this is Lobster's Office Hours. If you are here, please sound off in the chat. Nice to say hello. But no worries if you want to be quiet. I don't call on people much. so this is office hours for lobsters which is this website i run it if you want to talk about anything that's happening we can chat about this what's this guy alternate link why is This, especially from Rahul, is actually a topic we will be getting into. It's on my planned topic list. So... God, I'm froggy.

04:51So if nobody has stuff to talk about... Then I work on the code base or the community or, or, or. Lots of stuff. Never enough time. And abstract. I always watch for these where they have descriptions because a lot of time people leave comments in the description. So if you read the mod notes, it's a pretty regular thing that I ask people to not write comments there. which is some of what the story merging UI is going to get at. It's making those better. So let's see. We've got a couple of pull requests I can work through, just one or two. And the first one here I think might be ready to merge. I haven't read it. But I reviewed this a stream or two ago. This test failure is almost certainly Yeah, it's that migration.

05:58What prefers media feature would be a North color scheme.

06:07Dark.

...16This This has suddenly gotten a little Byzantine. But I see what it's doing.

...42This test matrix of what does your system prefer What does your user setting prefer? We've kind of blown up that state space, which I don't love, especially because we can't really test it without dragging in a whole browser. And I would really rather not drag in a whole browser engine like Playwright, because that's what it would take, was we need to have the browser load with different preference settings. And then work through the matrix of all of the combinations of user settings. And then not just look through which style sheets get linked, but look through all of the actual CSS. Just honestly checking the background color or checking the text color would be enough. But if this were a commercial project, I would be reaching for that. Yeah, this is... half of the test. And I probably can't even run this locally. I think.

08:00All right.

...07This is not marked as a draft. And the only way you would know it's not a draft is that you can convert it to a draft, because not a draft, there is no term for that in GitHub. I griped about that last week, but it is a pet peeve of if you have a foo, and it can either be adjective or no adjective, you have a bug, because you don't understand something if you can't name both sides in parallel. So now we have blank PRs and draft PRs, and you don't know which one you're looking at, except that non-draft PRs can be converted to draft PRs. AnakimLuke there are blank PR's?
This is not my favorite UI. All right. Well, I say blank PRs because there is no term for a non-draft PR, right? AnakimLuke normal pr?
So there isn't a, it's either a draft PR or a fill in the blank PR. And so there isn't any indication here of which it is, except that, right. AnakimLuke hmm
normal is they literally i am complaining that github doesn't call it normal and normal is a terrible term because if i was looking at a pr and this said convert to normal what would that even mean and the fact that they don't have that term is how you know this is maybe a little half-baked Maybe they wanted to introduce a whole different noun, that draft PRs should be a different thing than actual PRs. Not that pull request is a great name, but after, what, 15 years, we're all pretty used to it.

10:20It is not actually a pull request, it is a merge request. AnakimLuke aww
Hi, Kat. So cat is on my lap, not up in his official spot. AnakimLuke cat cammmm
So no cat cam, but he's around. AnakimLuke pay your cat tax
We'll see how long he hangs out before he gets wigged out about something and leaves. Oh, there he goes. He's been high strung lately. I think he doesn't like the cold snap. It's in the stream archive. All right.

11:58AnakimLuke LGTM YOLO DxCat
AnakimLuke LFG
Yeah, you know, this one is CSS. And people definitely are not quiet about speaking up when the text is funny colors. So we'll find out pretty quick if it's broken. Assuming I can deploy it with the build messed up like this. This migration thing. The replying comments view is just, I'll get into it in a minute.

12:51Go on. All right. It's two commits. Fine. And then fix the message because GitHub creates bad merge messages. I guess part of my frustration is I know GitHub is unlikely to get better at this stuff. Come on, look at that. The whole front end has just been subsumed by React. And it's gotten so flaky over the last six months. All right. So for topics, I was going to merge that down. And then let's go ahead and...

13:51Oh, I started my vim in the wrong. rahul1990gupta If time permits, it would be nice to get your thoughts on https://www.twilio.com/en-us/bl… https://github.com/lobsters/lob…
There we go. Hey, Rahul. I just saw that you submitted it. And Let me kick off this deploy, because I honestly don't know if it'll work. And then we can change our topic order around to talk about that, because I would really like to talk about that with you. So there's the issue with scenic that I think is going to just force me to rip out views if bumping scenic doesn't solve it. rahul1990gupta Yeah. :D
But I did see a minute ago on stream, just before you joined, that you had submitted this post about SQLite versus Postgres, which is exactly the decision we're having. I usually skim the comments first.

15:19rahul1990gupta really good comments from teh community.
Yeah.

...25AnakimLuke what db is it currently running on?
This one from Aryan Samaria is actually a little concerning because I, well, so is the one from Felix S because I don't actually want to be performance tuning the database much and instrumenting. I really, really want stuff that works out of the box. All right. So they chose SQLite. AnakimLuke i hate it when I can't enlarge an image πŸ˜…
okay so not a lot of articles six and a half million this is this is kind of odd because they're not describing an especially large do they talk about yeah too small to see so what i'm curious about is are they saying that this is AnakimLuke yes!!! i do that too haha
six and a half million reads or six and a half million writes a day because those are two very different numbers i wonder if yeah no that url is just a big slug sometimes you look at them and you see like dash 300 by 200 on the end and you can crop that off to see the full thing rahul1990gupta i think its reads because its an internal metrics dashbaord.
So I was trying to see like, are we talking about reads or writes? At some point I realized, I'm just taking a few seconds.

16:58pushcx https://github.com/lobsters/lob…
Oh, so I should give context for everybody who is not Rahul. Okay, thanks Rahul. Oh, you just brought this comment in since I started the stream. Great, thank you. I was going to have to jump over to the other one. So we have been talking about moving off of MariaDB and we've been considering Postgres for a couple of years, but nobody really compared the two and there wasn't enough difference to make it worthwhile. And then Rahul left a big comment recently. Where was this? Thanks GitHub. Why would I not want to read the comments? Jesus Christ.

17:47It's so hard to use GitHub. It gets worse every week.

...55So this is the comment I'm thinking of from Rahul starting, I stumbled upon this thread, where he kind of woke it up and said, actually, Postgres now has really good support for all of the features that we weren't sure it supported. And because he has a lot of experience with databases, he's looking at doing the actual port. With Joel Drapper on a previous stream, we talked about whether SQLite would be a better choice. And there is a bunch of cleanup stuff we know we can do regardless of what database we want to move to. Where most of this is done.

18:45Yeah, I'm going to go ahead and check this because we've got almost enough of them. And this was Rahul's work. It's not 100%, but it's enough that it will greatly reduce the cost for any kind of move. So Rahul has been an excellent contributor lately. AnakimLuke is lobster's schema v complicated?
He's taken on a lot of very unexciting chores and plumbing issues. All right, so back to this article. The Lobster schema, the only complication in our Lobster schema is number one, the replying comments view, which is why the build is broken right now. And then number two, we use recursive comment table expressions to pull comments out in the correct order. And if we move to SQLite, it does support that, so does Postgres. Postgres would allow us to explain it to express that query a lot better. And SQLite doesn't care about one plus n's, so not only can we express it nice, we don't have to do it and we can do the naive thing and not take a huge performance hit. rahul1990gupta Yeah.
either way yeah talking about running pg loader which rahul i think you ran pg loader and tried to see that it would work for us right i think at this point two or three people have yeah

20:36rahul1990gupta but, it wasn't able to migrate the fake_data from mariadb to postgresql
Every time I see someone write a straightforward benchmarking script, I think there's like a 50% chance that it has some kind of bug that turns the results into nonsense because I've been bitten by it so many times where you actually accidentally include some overhead on one side of the test that you don't have on the other or Like this creates some sub-process and you find out that the overhead of that is swamping whatever you're trying to measure. I don't know. Benchmarking is really hard to do well.

21:31All right.

...52When you say you weren't able to migrate the fake data, you don't mean the task, you mean the data it generated, right?

22:07rahul1990gupta yes. the data
Yeah. And that's concerning because the fake data task does not even have the complexity of our real world data, which is going to have Character set encoding issues and other stuff.

23:02rahul1990gupta can you go to this part where they migrate from sqlite to postgres After a couple of tries, the import process worked without a hitch. The initial failed attempts alerted me of a couple of potentially serious issues I had in my database design, which SQLite decided not to report or care about:
Oh, wait, did you already try and port lobsters to SQLite? I'm guessing you picked up the widget work.

...42rahul1990gupta Can you go to this part where they migrate from sqlite to postgres in the blog ? they ran into some issues due to sqlite's flexible data type.
rahul1990gupta https://www.twilio.com/en-us/bl…
Are you including a link? Because if you are, the Twitch chat is stripping it out. There you go. So this part of it. uses SQLAlchemy. Yeah, similarly, we use ActiveRecord, which mostly covers over the difference between the databases.

24:27Yeah, I saw this part about pgLoader, but I skimmed over it fairly quickly because I assumed that whatever issues they had would be very specific to them and unlikely to apply to us. I'm a little concerned by SQLite's very casual attitude towards data integrity. We've already had issues from MariaDB where it will allow you to insert certain kinds of nonsense where For example, there isn't Boolean support, and under the hood it's a tiny int with the values 0 and 1 for false and true. And if you pass in a string, it's quietly converted to an integer in a surprising way. I don't know, this kind of silent... alteration where things work. But then, instead of erroring out, we've already had issues over the last dozen years. I kind of don't want to have more with SQLite.

26:14And I've We've done a bunch of stuff with Active Record, Doctor, and I think there was another gem for catching these kinds of schema issues. I don't remember the name of it.

...35pushcx https://github.com/lobsters/lob…
Database consistency and database validation. Yeah. So maybe these issues are pretty minor if we want to use these tools.

...55So we've merged a bunch of things. They're not complete, but... Yeah, so the other thing that there was to talk about, and it saves me some hassle that Rahul has copied and pasted his comment over, is... He has made a more thorough investigation of whether we can port to SQLite. And flexible typing is this dangerous thing that I'm worried that we're going to get bitten by. Single thread writer is a performance issue. We would have to turn on the write-ahead logging. Let me pull in the comment I started writing in reply. So that was here. So I pulled it off stream because I started writing a long GitHub comment. And I was like, oh, we should put all this discussion together on the one issue. Because even if GitHub can't show 20 comments at once, you can read down it. Yeah, so this one, and then materialized views are currently breaking us in another way this morning. And then full text search has a bunch of questions. So Rahul, you can read through it, but for writes, our write load is fairly low. The most frequent writes are the read ribbons, which is when a logged in user views a story, we upsert so that they have a record of when they last read comments and get an indicator of unread comments. And then with recursive, I talked through a little bit. It's great that it supports it. We may not even need it to be supported. The views are currently breaking things and are not long for this database, I think. And then last, this FTS5 index. I read the doc for it, and it sounds like it supports all of our search features where we can have Boolean expressions and full text search. I didn't double check that we can

29:58No, I guess you can search multiple rahul1990gupta it also support porter stemmer, which was a pleasant surprise.
multiple indexes at the same time that's fine so when we do a text search we search the title field and the story text field description and the story text table and as long as we can do all of that that's fine i don't remember if i materialized it yeah a little bit so story texts Yeah, that kind of stemming search would be nice. We are only doing exact searching right now, which is not great. People do occasionally complain that the search index doesn't work because without stemming, it's hard to find things. So performance, for performance here on MariaDB, This story text table exists because description is a very wide column and making our story table so wide meant that migrations like adding a simple column to the stories table would take 10 minutes of downtime just because the table was so wide and variable width. So I shoved the story texts off to their own table and that solved a bunch of performance hassles actually. And then after a while I came back and I copied the story title and the story description over here to this table so that we could only, we could do, the search engine could just hit one index for all of these fields.

31:49And so this looks like it would port very neatly to SQLite. So On the topic of SQLite versus Postgres, they seem like they both support our feature set. Let's move it down here.

32:36AnakimLuke i didn't know recursive sql calls were a thing! huh
recursive sql common table so they're called recursive common table expressions and they are so powerful especially because a lot of the data we want to deal with is tree-shaped whether that's like nested tag structures or self-referential things like our user table that looks at the other users

33:15Sorry, a little noisy here for a sec.

...28rahul1990gupta @AnakimLuke https://www.sqlite.org/lang_wit… examples on this page are really nice to work with.
So we... Let's get that back. Had some background noise. I had to mute and pause. And they're very useful for our comments that, of course, are self-referential by being threaded. Ooh, that looks nice. It's a promising URL. Oh, materialized. Interesting.

34:23Sounds like our comment would want to have not materialized for pushdown, but that's real interesting.

...46Do not... implement performance optimization. Do not try and outguess the query planner unless you have a very good reason to. Yes, always good advice. So one fewer VPS.

35:21AnakimLuke @rahul1990gupta cool! I'll check it out! DBs are a bit of my weak point. I can do the basics but more advanced stuff like this is new to me!
So knowing they both support our feature set all. Postgres because.

...52rahul1990gupta in favour of postgres - access to database without having to ssh into the application host
I'm going to put kind of infinite scaling because we, Postgres supports, you know, not only could we stand it up on its own server and then also do some kind of clever multiple host thing, you know, our growth curve is probably lower than, well, I know it's lower than Moore's law, so we have infinite scaling. That's kind of true of SQLite, where I expect performance will be fine indefinitely, but it's not a certainty the way it is for Postgres. And some of that is I am mostly making a statement about my familiarity or lack thereof, rather than this being a property of SQLite.

36:57Rahul, that's actually a security control. So I could set MariaDB to listen to the public internet, but it doesn't because I wouldn't want any chance that someone could connect to it besides me. So I'm using the web server as a bastion there. If it's the only thing allowed to connect to it, then even if I screwed up and I pasted the MariaDB production password right here on stream, no one could use it unless they also hacked the web host. And this is kind of a 90s bit of security at this point. The right way to solve that is probably just use tailscale, but we're not quite at the level of maturity where we need that.

38:08Yeah.

...43Frici sqlite catches a lot of flack but in fairness for a single app and on a single host it also is fairly infinitely scaling (at least to the point where the DB itself isn't your real bottleneck)
Frici also morning πŸ‘‹
SQLite catches a lot of flack, but in fairness for a single app and on a single host, it's also infinitely scaling. Yeah. Good morning, Fruity. Have you run SQLite in production? It helps that Lobsters is a very read-heavy app. I mean, every app tends to be read-heavy rather than write-heavy, but

39:14Us especially. To the point that we can do full-page caching. Frici more often than people allow me to admit LUL the point it does get more heavily complicated is multi-db and multi-replications
So... You know, one benefit... Yeah. rahul1990gupta for postgres : materialized views.
And I know with SQLite that enough people have used and scaled it that there are things like having read replicas that I know there are solutions for on SQLite. And so honestly, honestly, I like it is true that you can scale post grass much higher. But our growth curve is low enough that we don't ever have to care about you know, are we racking our own servers to get vertical scaling? Are we having multi-master sharding and all this? So Rahul, I think you and I have had some confusion about materialized views where we have the one view replying comments and it's not materialized. and i talk about when i have talked about materializing it what i mean is i want to delete it and not have any kind of view and have either a replying comments table that we insert and delete records from or have a general notifications table that we insert and delete records from because using a view has just caused us a lot of pain. When I... And it's mostly pain because Rails doesn't really support views, and that's a pretty foundational... I will say choice of Rails, rather than include a judgment there, but...

41:53Given that rails doesn't support them well. We just keep getting these frustrations and our current one is that scenic has broken migrations because it doesn't know about us having multiple databases. And one of the things okay good that at least ran one of the things I wanted to do on stream was try and bump scenic and see if the problem goes away, because maybe they've addressed it I looked in their issue tracker and didn't see anything about it. pushcx https://github.com/lobsters/lob…
So for anybody who hasn't seen it, I'll bring this up here, but not this. I just filed this last night because I was really frustrated and I felt like the way migrations were broken on my system was due to some kind of dumb typo or misconfiguration and I have looked at it too much to see it anymore. And so in the chat room, I asked Caius to take a look at this and see if he could figure it out. And he spotted something I didn't. He sees that it's actually not an error with a migration, although that's why the build is failing. So maybe there's two problems here. AnakimLuke I'm just starting to learn rail's ORM. does not abstract models enough to make it easy to switch between DB's?
It is an error trying to dump the schema afterwards, and Scenic is trying to dump out and see if there are any views, but I guess it doesn't know about SQLite. So I saw that it was sending... AnakimLuke I mean like, why not try both?
So Anakim, it tries to do that. It tries to make things abstract enough to switch between databases, but we have, if you look at the checklist in my comment, pushcx https://github.com/lobsters/lob…
AnakimLuke I ask because you obvs see a lot of the complexity I don't
we have a bunch of things where's this darn checklist yeah here come here give me this link we have a bunch of places where we have to drop back to raw sql and we end up using database specific features because Like we have a string that calls a date function and the MariaDB chose a different syntax for the date function than Postgres did. The SQL standard revises very slowly. And there was a period in the early 2000s where from my perspective, it kind of stalled out and didn't take in the complexity that databases were adding. And so A lot of very common things like string functions and date functions and recursive common table expressions were implemented with non standard syntax is because there was no standard. And then no database wants to break backwards compatibility, and so they permanently work differently, which is. pretty frustrating. and Rails has had a pretty naive approach towards using the database. I think I've found it. Is it in this browser history? Yeah. So this...

45:44pushcx https://dhh.dk/arc/2005_09.html
There is a mistake that DHH made early on in Rails development. called Choose a Single Layer of Cleverness. So you'll have to control F for it because it doesn't have a separate page, but basically in 2005, he said this kind of dumb fight-picking rhetoric about Oh i'm fighting with the database over whether it has the business logic and this wasn't just about stored procedures and constraints, it was which I actually agree with him about I don't think these features are. really very usable and non trivial databases. But. This attitude led towards a failure to take advantage of database features that is pervasive in Rails and has only started getting corrected in the last year or two. And so this is why Rails didn't have good support for recursive common table expressions until six months ago, eight months ago, something very recent.

47:17And since it didn't support it, we had to do raw SQL. And so a lot of our code is dependent on MariaDB syntax. So this issue and the checklist in it, or this comment on the checklist in it is about doing cleanup of things now that Rails has started correcting this mistake and making it possible for us to switch databases. whether that is switch to Postgres or switch to SQLite. Oh, I did this. pushcx https://lobsters.zulipchat.com
So Rahul, you may want to join this Zulip chat I created for Lobsters. It's very quiet. It's barely started now, but it's lobsters.zulipchat.com, just as a place to talk about development. And I want to be able to tell people who run sister sites about these kinds of breaking changes because replacing your database is definitely a breaking change for everyone so kai has found this issue and it's funny because i saw this show full tables and i went oh it's trying to talk miss mysql or mariadb to a sqlite database i didn't realize i was seeing oh it's specifically looking for view stuff this is scenic all right so it's so he can run he can dump the primary fine but when he dumps the cache all right let's i want to recreate this failure and this is so annoying because it it doesn't build up the file and then write it once and instead it writes it yeah so if you look you can see my little indicator in the command line it has destroyed this file where What's left in the file is the start of the declaration with no matching end, which is frustrating. All right, so let's try bumping that.

49:34Because maybe they've dealt with it better.

...40Yeah, all right, so let's say... No.

...53That's unfortunate.

50:05I don't want the extra gems hanging around. All right. So Rahul, if you're still on, is there anything else you wanted to talk through with considering SQLite and Postgres? I don't think we have any other great ideas about why to choose one over the other. And if we can get... We'll have to do a performance test just to make sure we don't break the site in production by migrating, although I really do have good confidence that both of them would be fine. And if they're both featureful and performant, the difference between these two is... mjiig But what colour should we paint the bikeshed?
not big this one this one feels like it's quite valuable to have that strictness on the other hand i have daydreams yeah mj AnakimLuke green!
It's getting down to that level of aesthetic difference if the two are both feature full and performant. there's not a lot of strong reason to favor one over the other. But if you want to talk about painting the bike shed you came in late because we already touched the CSS for the site. Alright, so.

52:06rahul1990gupta can you talk about the daydream of service ?
So Caius opened a pull request that I haven't taken a look at yet. Oh, the daydream of service, yeah.

...24Let's see, where was I? rahul1990gupta do you want to be a downloadable software or something like ONCE offered by basecamp
Let's look at this.

...36Actually, I don't need to, I'm a little curious

53:03Yeah, we don't touch README often. And so I thought it might be in here. Ah, here it is. pushcx 4d119cec
So I had this commit. I used to have a note in the README 2019. I had thought it was 18. saying are you interested in running your own sister site and not technical or otherwise willing to pay for hosting and support maybe you're a reddit community unhappy with their redesign because this was right when they launched their big redesign or you want an internal site for the company or you want to experiment with community design please contact peter and i gave my email address i'm exploring the idea of a hosting company to run sites using the code base or maybe consulting on custom features and would love to hear from you the only change to lobsters would be that someone's getting paid to pull request back bug fixes. So this is I had maybe I had maybe 10 people contact me based on that. And I talked to 20 more people that either run communities or were exploring running communities. I love online communities. I have a lot of opinions about them. I think there should be a lot more of them. Lobsters is a nice start. It is very opinionated and very tailored towards how Lobsters wants to work, but could be made to support more things without too much work. And we can see that with things like Game Dev City. So I was just talking to the guy who runs Game Dev City. And he just got linked from Hacker News over the weekend and is having a flood of activities. I really do hope that... I think one of the troubles with... Hang on, let me back up. There are two problems with running lobsters as a service. Number one is it's very hard for new communities to succeed. And I think we can see this with Game Dev City where these things have 0, 0, 0, 0, 0, two comments, 0, 1, 0, 0. It's not quite an active community yet. You have to have a core of people that want to come back every day and leave comments, and that is a very hard thing to achieve. And Game Dev City is struggling, I think, just below the level of viability. I worry about it. And on a previous stream, we went through the list of... I updated the Wiki where There are a couple of websites that use the codebase, and if you look at these comments, none of them are very active.

56:29I don't know that I would call any of these a healthy community, and it's not that I want to insult them just it's brutally hard to start a community and grow it and you can see it by the list of defunct sister sites that people started or tried to start and that includes me this one barnacles was me i ran it based on the code base talking about bootstrapping and entrepreneurship i never got it off the ground so it's really hard to write a hosting service where To run a hosting service where all of your customers have to take on an enormously difficult project or fail. Frici it doesn't help that these guys are starting to run a community from entirely 0 while lobste.rs started from spite and got a surge just about from the same spite LUL
And then the second part of it was because Facebook groups and Reddit groups are free.

57:25People think that $5 or $10 is a lot to pay for hosting, and it is really not. That is, $5 or $10 is free hosting. But if you're looking at the kinds of dreamers who want to start communities and they are comparing you against enormous companies who can host free communities as a loss leader or slap ads on your community, it feels like a lot. And I'm going to get to Pritchie's comment in a second here. So that's why I say it's a daydream is if I wanted to, I could spend a week or two and set up lobsters as a service, you know, somewhere that you would go and sign up on things. But honestly, I don't see any reason to think that I wouldn't just be wasting a week or two of work trying to set up something that cannot be a functioning business. And it kind of breaks my heart because I would love to work on this full time. And it would mean a lot of code flowing back to lobsters because as it is, I have to be very strict about only spending about one day a week on lobsters. So if you look at my streaming, you know, I do two, three hour sessions. And then usually like on a Saturday or Sunday, I do an hour or so of coding or other kind of maintenance stuff that I can't do on stream because I'm talking either production data that has PII or I'm touching production passwords, and so I try and timebox this. rahul1990gupta and the idea is sqlite will bring the cost of running such a service down for you or other community manager?
I would rather spend 40 hours a week on lobsters than eight, but that's not something I can do. Frici I am being a bit facetious, but under it, it's still part of the main point. the code and the hosting is a good start but marketing and pushing enough work is far harder than people think
So then, Fritchie, the second part of that is I actually disagree with you about how lobsters started. The spite helped. Hacker News was in a really rough place in 2013. Paul Graham, and he has said this, Paul Graham was not doing a good job moderating the site in ways that took, dang, like 10 years to clean up. And there were a lot of dissatisfied people. But then two very unusual things happened when Lobsters got started. Number one, a lot of the early users call it the first 50 users of lobsters all came from an existing healthy community that was organized around a shell box for OpenBSD. I don't remember the name of it, but JCS is a contributor to OpenBSD. And the first 40 or 50 users were basically everyone from that shell box that they shared signed up all at the same time. And then the second thing that happened was me so i'm a big weirdo and i did the really unusual thing of submitting a dozen stories a day for 18 months so i joined the site about six weeks after it started but it didn't start that immediately and that kind of ridiculous effort is what it takes to actually start a social site and build a community people had to come back for months before they were like, oh, there's actually a lot of stuff here. I'm going to start leaving comments. Oh, there's always a comment worth reading. hono4kami hii
I should write them because it's worth my time. That's really hard. hono4kami wait, is this lobsters???? wow
So Rahul, yeah, SQLite would make it a lot easier to host lobsters, especially it would make it a lot easier to host forums that may not succeed because There isn't another running service, and one extra file on disk for SQLite is very cheap. Hey, Hono Furukami. Yeah, this is Lobsters. So this is this website. I'm pushcx. I run it. And you can drop in and ask any kind of questions, or you can watch me work on the code base if nobody has questions. So we talk about issues in moderation, in running Rails apps, in et cetera.

01:02:04hono4kami Oh wow, you're the admin of lobste.rs!
yeah marketing and finding people who want to start forums is a a hard thing you know there's that joke i don't talk about entrepreneurship too much on lobsters because it's off topic but i have a lot of background in it first time founders talk about product second time founders talk about distribution there are enough dissatisfied reddits that finding people who want to start forums is pretty straightforward it's hard to scale pushcx https://push.cx/stream
AnakimLuke I guess that's one advantage of subreddits: you don't need to come back to *taht one specific* subreddit, as the main page will show everything you are subbed to
they don't want to spend money though so yeah i'm the admin of lobsters this is office hours if you go to here there's a lot more here yeah so i do these streams because of that kind of reaction of i don't want to be unapproachable i want people to understand that they can just drop in and ask questions yeah anakin the other thing that helps a lot if you are trying to get over that point of viability to solve the chicken and egg problem when you are small it helps that there are a couple of million potential users who are already sort of logged into your forum and it becomes a problem when you scale like once you are a healthy forum and a working community The fact that millions of people are already logged into your forum and can brigade you is a big negative. It's really hard for subreddits to enforce rules and maintain a cohesive culture when there are always several million people ready to drop in and swamp you. But... I don't know. I think there's a lot of potential. know somebody asked about would lobsters accept a feature to support oauth logins i would add it to the code base i don't know that i would add it to lobsters the site i would think about it but i would add it to the code base we have similar features that the site doesn't use and as long as they're cheap to maintain happy to but then it's you know if it's a single button to log in with github log in with facebook log in with google you get most of that benefit And a lobsters as a service could aggregate in the way that subreddits do. Log in with lobsters oauth, right? Nah, it would need a new name like lass. I don't even know what I would call a lobsters hosting thing. It's just a daydream of I really like communities. as long as i'm here looking at this i was just playing with this yesterday so you can see i have my to-do list and i'm constantly tinkering along with it so a bunch of stuff has gotten done recently so i tagged the streams afterwards with things about them but if you wanted to say see all the streams where i talk about performance you can either ctrl f for performance Or now, I just hacked up Jekyll yesterday so that on my tags page, we could go here and look for performance. And if I could spell, I could find it faster. And then all of the streams where I talked a bunch about performance are listed. twitchtd lobsters as a service? crab trap? the boiling pot? lobster people?
This is all alongside all of my usual blog posts, and so I put a little play icon next to the ones that are streams. I'm really happy with this. Customizing Jekyll can be a little bit tricky, but it's all Ruby. Crab trap, the boiling pot, lobster people. Yeah, actually, the... Ooh, am I logged in in this? Okay, I'm not logged in, so I can show this. The... Oh, it's not set unless I do log in, though. Our cookie... Our session cookie is labeled lobster trap. AnakimLuke πŸ˜…
People don't often notice it, but it's there.

01:06:40So Twitch, the other way to go with naming lobsters as a service would be, you know, call it Talkit or something. Because despite the name, Reddit has really shifted hard the last five years, six years now, I guess, towards image and video consumption. It's less about discussing and more about seeing memes and seeing videos. GeordiFouronnes the tiktok-ification of everything
So I suppose that would be a feature people would want for lobsters as a service is image and video uploads and stuff. The TikTokification. Yeah, Jordy, it's not even that. It's before TikTok, although TikTok is taking over Reddit. God, so much vertical video. And I mostly read discussion forums, but there are so many of those things. dr3ig It would be hard to compete with discourse
The last, what, year and a half, two years? TikTok has just taken over the world. twitchtd tiktok is just the consequence of lower attention spans
People really want to watch TV. Heck, even I wrote a blog post about TV. Discourse? God, I hate discourses so much, UIs so much. I was just on stream earlier griping about how unreliable GitHub has become the last six months as it's shifted absolutely everything over to React, where I hit back. It's not even on this one. But things just kind of clunk around, and we do these in-page loads, and then I hit back, and the comments are unloaded. Because React can't handle rendering 100 comments on a page at once. And so they have those painful, like, see more comments in the middle. And discourse is so bad about this. It just doesn't work. rahul1990gupta I was and still am rooting for mastodon and its decentralized and federated service. Sad to see its slow adoption though.
I search for stuff and I find discourse threads. And I end up just bouncing off of them because I know I can't control F to search. I can't scroll the comments. Things pop in. So...

01:09:04Yeah. I don't know. Discourse. rahul1990gupta could it have been adopting faster if it used sqlite and simpler deploy
They have all those same challenges of it being hard to start a community and you can see their business strategy there has been to focus on corporate communities where rahul1990gupta -ment process.
Frici true rahul
business wants to start a forum for bug support or a forum for their coaching service the lobsters looks a lot like reddit yeah it's possible to head that direction add some kind of authorization and break things out into sub forums but honestly one of the nice things that lobsters have that discourse kind of can't have or it would be a multi-year project is performance pages actually load where discourse i view a random thread with five comments and it takes five or ten seconds to load i scroll down and i watch new comments stutter into view and dr3ig Technical people are very polarized over discourse. Non-technical people don't seem to care too much
It's hard because no one deliberately goes, oh, I want a performant forum. But the actual experience of trying to use it is it just feels pleasant to use a performant site, and it's just irritating to use an unperformant one. And I hear that all the time about discourse sites. twitchtd discourse is something I want to like, but never end up liking it
Yeah. Yeah, Mastodon. is an example of a Rails app with a lot of dependencies and a lot of moving parts. Moving to SQLite would be one fewer dependency for us. And Scenic is one more dependency that's causing one more issue.

01:11:20Oh, oh, Clemeth has figured something out. Clemeth, are you here on stream? I know sometimes you watch these. I don't see him listed in the chat too bad. Huh? That's wonderful.

...45So I could just, all right, well, I don't actually want to have to rewrite notifications in a hurry. So let's kick the can for a second.

01:12:08And then where's that dump? Oh, man. No, I still have the issue.

...30What value did I have? It looks like somehow I... Oh, he's talking about DB schema, not... All right, hold on. I'm not keeping track of my tabs here. Let's quit that. Check where we are. Let's restore the DB. dr3ig There is no issue if your database.yml has not been updated to use cache/queue databases
And then DB schema. GeordiFouronnes feeling very uneasy about the cursive literals :O
dr3ig Which was my case
So this one does actually have the wrong date for the migrations. This should be the date of the latest migration, and it's missing one, which is why it's trying to run that.

01:13:21pushcx https://github.com/lobsters/lob…
Yeah, Dreg, if you look at the issue, I pasted my database. So I do have those configured. No, this does not actually fix the issue. I really wanted an easy fix, because even if I had to kick the can.

...50So it knows that I updated that. rahul1990gupta remove the cache.sqlite3 file and run rails db:prepare
Let's double check that time scamp. db migrate tail ocean2. 2025, 02, 03, 223, 624. That part is correct. Remove the cache and run db prepare. Can't hurt. twitchtd is show full tables where ... a postgresql thing or a sqlite thing?
Let me restore the db cache schema.

01:14:35ShowFullTables is my SQL syntax.

...44So, Rahul, we're back to this issue. This is the last migration.

...57twitchtd oh but it's running show full tables with sqlite
I must have committed the migration and failed to have run it before I committed. twitchtd got it
Yeah, so Twitch, that's the core issue. rahul1990gupta rails db:prepare:cache
What is going wrong with this migration? Because this one is just... All right, let's check where I'm at.

01:15:33Well, that's not even a command. We can try create.

...43It says it already exists, which didn't I just, I deleted it up here. One of these things tried to recreate it.

...55So now if I run migrate, no, it still blows up.

01:16:35twitchtd would it make sense to look at the commit from when this was happening? Is this only happening for you or is it reproducible?
So let's... It's happening to me and it's happening to the build server. So if you click on the issue, you will see where I link to the build server and it's having that migration bug. How is there still more of this? See, I don't actually want these collation things. This is one of those... twitchtd ah ok
rahul1990gupta I had this issue when i was working on solid_cache PR . I think i fixed on my machine by deleting and running db:migrate
little hassles where it's very easy for this is like a maria db thing where they've redefined collations and they've maintained backwards compatibility so let's push that up and then drop the collation changes because at least it's not that

01:17:50So I was running specifically. So let's try. One thing that's missing from this is it doesn't say which database, so it could be the cache, and it could be the other one.

01:18:54Can't even run prepare. I see this is so, like this is at least a different error. Whatever these two things are, they're caught up together and I'm not getting it. So if I look at stories, it's mad that the stories count exists, which is fair because it does exist. But if we look at this, It's already recorded that it has run that migration. So what is it trying to do? Why is it trying to run a migration that it has recorded that it already ran?

01:19:46Just something is weird and broken here, and I don't get it. I feel like I'm missing something obvious.

...56like this version, Yeah, right now.

01:20:07That is the migration file. Did I rename it in the migration? I've had this happen once or twice.

...21So it's just called count merge stories. It doesn't actually Sometimes if the name changes inside the class where it doesn't match the file name, things get weird, but that's not the issue.

...43This is the first time I've seen an issue like this with Rails migration, where it's getting all freaked out because it wants to run a migration that it's already run.

01:21:03twitchtd i just pulled master lobsters and it seems the cache schema.rb file is broken
So if I run db migrate, it knows it doesn't need to run the migration, and then it fails anyways. The cache schema.file. That's cache underscore schema, right, Twitch?

...34And the thing is, it keeps breaking when you run db prepare. But if I actually go look at what's committed on master, it's not broken. Because I don't think I've managed to commit it broken. No. This is fine. twitchtd nvm pebkac
This is totally valid.

...55So if you ran, I don't think it's pebcac. is weird and misconfigured here. So if you run git status, you will see that the file gets mangled. twitchtd i ran rails db:reset and it mangled the cache schema
And I just restored it, but... So why does...

01:22:37Yeah, and Caius narrowed it down to GitHub. So if you restore that file and then run schema dump, it should be fine. And if you run, or I'm sorry, schema dump primary should be fine. Schema dump cache is throwing this error. Let's just try this. The only diff should be that unrelated collation thing. Yeah. So I feel fine throwing that change away. But then if I run this with cache, boom. And then it mangles the file.

01:23:47See, the fact that prepare is failing is so odd to me because it shouldn't run setup. The database exists. And if I manually run migrations, I don't get an error.

01:24:06I say db migrate primary. Yeah, no error. The one spurious thing, but no error. But DB Prepare blows up. It's so weird.

...48Oh, wait a minute. So Clemeth has a PR that has a green merge. I just replicated this work. This pull request should have a, why does this not have a conflict? I pushed my

01:25:22223. 23, 223, 624.

01:26:38And this is the exciting times of software developers. Just shit's broken, and we can't figure out why. twitchtd let's see openai figure it out XD
So this pull request, we can dump. We can't dump this. Scenic doesn't know. Let's see. Open AI. twitchtd yup
Good luck with that. If it's a novel issue, you're going to get it. Nonsense. The only issue is the linter didn't run. It says pulls in an adapter.

01:27:43He's also got this same fix. So that's definitely me adding problems. This is so strange that this has to be customized.

01:28:03I get what he's doing, but I don't understand why Scenic doesn't do this because Rails 8 has been out for a minute. And scenic is well maintained. See, I was talking earlier about you can tell it's a draft PR. dr3ig scenic has some open issues related to multiple databases
This one says draft and doesn't have the draft button. But there's no indication of what the non-draft is called. Does it have open issues? I was just looking for SQLite issues.

01:29:05twitchtd https://github.com/scenic-views…
AnakimLuke is there any indication it's a draft?
dr3ig #399
dr3ig you found another
402. Okay, I'll look at 399 in a second. Thank you for finding these.

...22And then they have a pull request that they merged, but they must not have cut a new gem or something because... Oh yeah, so here's someone who's coming from Postgres but has the exact same issue.

...55And then there is an open pull request, a closed pull request.

01:30:09dr3ig this is a different repo ?
Why is it closed?

...22So it sounds like the maintainer is not

...35It's a different repo, but it's a dependency of scenic.

01:31:11All right, I think I'm going to just take this. If it fixes the build and fixes my local machine, and then, yeah, notifications has got to come up. We can't keep depending on this, especially if they've known about this bug for two months and not addressed it.

...59What is this about?

01:32:31dr3ig if the issue is only with deployment: you could try to replace `rails db:migrate` with `rails db:migrate:primary`
Yeah, that's not actually relevant.

...51OK, so this is just matching Rails API. I can't really, I would edit it in the merge commit, but as long as the build is breaking, I'm just going to take it and merge it. So this.

01:33:27Was it 409? What was the first one? 402. That's how Rails-y. It's issues, plural, but it's pull, singular. That's what I was confused by.

01:34:19No, the issue is I can't even run dbmigrate locally without weird failures.

01:35:52So this is another annoying thing about this new draft feature is PRs are a draft by default, but people aren't familiar with it. And so instead, we just end up with it's never clear if the author intended for it to be a draft or is just unaware. And I guess it's frustrating because usually GitHub is very polished, but draft PRs, this new merge experience that you can't see, that's what this says. Try the new merging experience that broke workflows and just all of this stuff. It's so janky the last couple of months. I'll put up with it another six months before I seriously start thinking of moving to another CodeForge, but it's just endlessly frustrating. All right, so let's pull this down. And then let's call it initializer scenic.

01:37:21So this, we'll need that open.

01:38:13Grab that out here so we can say adapter.respondTo. pgronkievitz yeah, GH seems to worse every month. I started using gh-cli way more because of this
And then that satisfies scenic and probably runs. Let's see if we can actually blown up my local.

...55Is GHCLI, is that a Python app? Oh no, you still think I have migrations. How is this migration pending if I have already run it?

01:39:12pgronkievitz it's written in go iirc
Is it just test? Is all of these tests and it's not been clear about it needs to run in test?

...23It's written in Go. Maybe I'll have to spend some time playing with GitHub CLI. The web interface has just gotten so flaky. Okay, so test is legitimately missing.

...43No, it's not. It has the column. So this is the test migration failed at some point and left the database in an inconsistent state. And then all of these errors have been that Rails has not been telling me that's mad about the test database instead of the production or the development database.

01:40:26What the fuck is this? Text, test. OK, now can I run the tests, pretty please?

...42No. You are attempting to modify a database that was last run in the development environment. You are running in the test environment. What?

01:41:00All right, so the specs actually run. What was that request number that I just merged? Let's hit.

...30Looking through the pull requests, closed. Where are we here? 1459. All right, so what's this now? This is, it wants to dump some headers on my files. Fine.

01:42:05Let's just add that.

...17So you know you don't have anything to do. I want to see the whole build run clean here. Without this weird error, whatever this is.

...43Attempting to modify a database that was last run in the development. What the fuck does this mean? Never seen anything like this.

01:43:05Oh, this is an old one.

...25Rails 5. Oh, yeah, GitHub. See, GitHub is doing the discourse thing where 11 comments. What a significant performance overhead there is to 11 comments. That might be an entire kilobyte of text. Who can load 1,000 characters? I'm griping and being unfair because I know that it's actually like all of these cross-references, but... Come on. That's the job of this page, is to let me actually see what's happening. And it's such subtle styling that if I'm quickly scrolling up and down longer issues, I miss them, and then I don't know that I'm missing these crucial links and comments.

01:44:19Okay, great. No clear... Frici I do wish it had a flag to always expand comments
At least the build runs. This is going to be from the SQL, isn't it?

...45Yeah, this is user's controller, but that's not where it fires.

...58Why did this go away?

01:45:04Yeah, because this thing switched to this. All right, that's fine. And then it noticed that a couple of these moved a little. So all of this is fine, except dbSchema.

...36Let's push all that up. Yeah, if GitHub issues and pull requests had a flag to always expand comments, would anyone ever want it unchecked? Would anyone ever say, yeah, I just want to miss a random number of comments in the middle of a long running thread? Because especially, you either know that the issue ran long in time or long in complexity. And you don't know how much you're missing. I wouldn't trust an LLM that was trying to collapse only the unimportant ones. You can't trust them for that kind of job. But it doesn't even attempt to do that. It's just effectively hiding Anything but the first 10 and the last 10 seems to be something like what it's doing. And so just knowing it's hiding random comments for you. So much of programming is picking through all the details and finding the one detail that really matters for your problem. So having a bunch of the details hidden, I guess that's why I'm so annoyed at it all the time. All right.

01:47:41Is it 79? 97? I can't remember. 1076.

01:48:11Not prioritize. Accelerate implies I'm already working on it.

...21I feel like I have a ton of work in progress and it's only getting worse. Work in progress in the lean sense. So, yeah. This is Lobster's office hours. If you have any questions about the CIDR codebase, you can pop up and ask them at any time. if not you can watch me struggle bus my way through working on the code base because that has been what this last hour has been unfortunately close that you know i say that the build is fixed but i didn't actually see that the build is fixed So now let's go find out that the build is broken. Yeah, passing, is that up to date? Yes, okay. All right, phew.

01:49:24In my personal life, I have learned very slowly, I have formed the habit of if someone asks me if I'm free for something, I have to pull out my phone and look at the calendar before I say yes or no. Always, every single time, because I don't have a perfect memory for this. On top of the fact that, you know, I'm married, so there is someone else who is entitled to put things on my calendar. Even just, I can't memorize my own thing, my own calendar. And in that same way, I want to say things like, oh yeah, the build is green. But I don't have the habit for, have I actually seen the build create? Did I go click on the actions and see it green? In the same way that I don't always remember to run the build locally before I push. All right. What's the status of this? It's a draft. Got a break man warning. Why haven't I merged this?

01:50:39This is, speaking of habits, I think this slipped through the cracks and I have failed to handle it. Does this work? Oh, so it shifts. This work from the database up to Ruby, which I guess it's fine. So someone was asking about SQL earlier. I think it is embarrassing for SQL that basic date functions are not standardized. And I say basic date functions, I should admit that date and time issues are seductively simple feeling and then actually there's enormous mind bending complexity under the concept of a date. Or especially once you put in time zones and offsets and do you want to handle that missing week in 1328 or whatever it was when they changed calendars? because the old one was slipping days. There's enough stuff to melt your brain in there. So fine, yeah, let's just do it in. We lose this union?

01:52:16Fine. If it gets us database independence, I don't have to love it. What is tally?

...36Is it innumerable? Turns a hash containing the count of equal elements. Oh, this is new to me. I wonder when it was added. That is the one thing that is missing from the Zeal documentation is version stuff.

01:53:01That's really quite nice. I've had to do this myself. All right.

...14Well, as long as it's cached, let it be a little more expensive.

...28Yeah, he's narrowed it down to just the fields. So we're not pulling back the whole thing. We're not hydrating an active record model.

...46So what's happening with Brakeman?

...55Breakman is concerned that unescaped model attributes that were passing what?

01:54:24Oh, that these values are going straight out to the front end. Well, not straight out, they're going into the graphing library. Okay, so I understand why it's warning. Let's check them all. Yeah. So these columns are not under user control. Yeah, see, again, is it a draft or is it not? The answer is not, or he probably would have said something. Can I just commit to this branch rather than breaking master again?

01:55:16Not clear. Let's just break master again. That's what the GitHub UI wants me to do. There we go.

01:56:29All right, so let's go ahead and pull this down. So folks can feel free to pipe in with questions about the code base or what I'm doing or the site at any point. Did I put that in the Twitch description? I hope so. Expect any new warnings. Then we're going to note these. And they all get a note that says,

01:57:18And I'm just going to be repeating this note over and over because there's like, what, nine of these warnings? So it's note, note, note, note. Yes, this one's the same. Note.

...43Yes, we can toss the old one.

...59and fix the build. Great. So, PG, Ron, Klevitz, you said just use GitHub CLI. This issue of a contributor submitted a draft PR and it's unclear if they intentionally did it as a draft or that's just the default, I can't fix that on my end. because I have no control over whether people can make draft PRs, and the default of PRs being drafts is obnoxious. We keep ending up in this scenario where pull requests stall because they look like drafts when they're not. And so I'm waiting for the contributor, and the contributor is waiting for a review. i literally can't review it unless i forcibly take it off draft and if i do that when it's not a draft you get the exact situation that showed up with prefers color screen at the beginning of the stream or prefers contrast because that one was a draft and was intended to be a draft and so i merged broken code thanks github and i realize i'm being twitchtd i thinkyou can turn off draft prs in settings if possible
entitled by griping about this but i'm in a no-win scenario where i am either not knowing that i'm getting draft code or the contributor doesn't know that they're submitting draft code can i here let's pull i'm so i'm pulling it off stream because i don't know if that's so i'm looking at the drafts our settings code and automation branches no Can you tell me what section you've seen that in? I don't... General? Social preview. What the hell? No. Wiki. Pull requests.

02:00:17So I'm in the... twitchtd nvm, i can't find it
There's no keys here. So I'm in the general setting for pull requests. I see merge, commit, squash, merging, rebase, merging, which I want. Yeah. If I could turn off draft PRs, I would in an instant. I hate playing this game of wondering whether a PR is ready to go. And especially with time zones like Rahul, this very active contributor. Great. He's 11 and a half hours off from Chicago. So if I want an answer to that question, I am waiting a day.

...56And it's Microsoft, so... There's not a lot of point in asking for things or explaining problems.

02:01:19Yeah, I'm going to leave this because we still don't know if we want Postgres. All right. So I'm going back to the scratch file here. And... I'm going to just knock my water into my lap. That would be great. All right. So we're working on stuff.

02:02:00I don't. actually so one of the things you know sometimes you make a pro and a con list and it becomes immediately apparent that one is better than the other or you figure out how to weight these things against each other and on this one i don't actually know how to decide so what was it was it issues 539

...32Yeah. What's left on my to-do list? Because it's still worth doing the cleanup.

...46Can I just, no, I can't actually edit. Are there any other select alls hanging out still? Because I know Rahul got some of them.

02:03:03OK, so the traffic helper still has one. So let's edit this.

...31And then this one gets to be checked off and was 1444. Save.

...56So one of the issues with this one was, And I've been thinking about this for a couple of days. So Rahul opened this pull request to replace our raw string with the new support for recursive CTEs that the Mastodon project added. And then he started on a migration to materialize those. after we talked about it.

02:04:46And then I... Then he just closed it, all right. I'm going to actually pick that part up because materializing depth and reply count is actually worthwhile in a bunch of ways where I want depth for fixing up the front end and I want reply count for maybe features on the front end. So did he write a migration? Yes.

02:05:33So I'm just going to grab this. Name doesn't matter too much.

02:06:10Let's bring this in, get rid of this. And then over on, where was it? The last migration for stories.

...32I had this, so we're going to need two of those. Default, yeah, so we do, the parent is zero, not one. And it makes more sense to me to go depth and then reply count. Starts at zero, yeah. So we're going to say, I'm going to do comments first because it's easy. Say comment, set reply count equal to, select count start from comments. as c inner where c inner dot parent comment id equals comments.id yes and then

02:07:37also going to have to add a last reply at because otherwise the counter cache is going to touch comments.updatedAt and I don't we use that in the UI for I think you can see when a comment was last edited and it would be bad and confusing if we overwrote that so this will be a big time and should be true These can't be known.

02:08:22Last reply at is. Select Max created at comments where yes, that's nice. it's it's continually surprising to me that rails doesn't have a built-in for this because rails really excels at the yeah you have a you know between a thousand and ten million records in your database in which case you can just do this naive strategy you don't have to be smart about backfilling And so I'm surprised that it doesn't just have that out of the box and then let you write the more complicated version if you know you have a huge database.

02:09:22Oh, I don't want to pull in the whole recursive CTE here.

...39all right because if i did i guess i have to to count how many to count the depth of a comment all right so let me tinker with this so i've got rahul's pr here. I'm going to grab this. Let's pull up the console.

02:10:24But then

...30If I do this, it doesn't see it was did he rewrite parents as well?

...42Because there's recent threads. Parents is the one I want. This.

...59recursive this is actually recursing in the opposite direction so with a recursive common table expression you give a base case like see what i would expect here is to see the base case be where the id is self.id and then the join is find the parent find the parent don't think this query actually works all right let's do the simple thing i'm going to do the dumb robust thing because this is run once code the most deeply nested comment on lobsters is 32 is 31 replies

02:12:25So let's just say where not parent comment ID is nil, where depth is still zero. So that's everything we know is wrong. Because if you have a parent, you can't have a depth zero. And then let's update all of those to have a depth that is equal to one plus depth from comments as c inner or c inner parent comment id equals comments id right so that's find your parents depth and add one select depth from comments as inner yeah i've swapped these this should be id equals This one is the... And then we'll just run that 32 times. What could go wrong? Let's look at this SQL first. Because I don't feel a lot of confidence with the Rails where and where not. So I just want to see what it outputs. I'm getting there. or comments. Yeah. Okay. So I got what I wanted.

02:14:08chamlis_ does it return how many rows it updated, so you can repeat until that's 0?
All right. That looks roughly correct. I could repeat till I'm it's zero, but I know that our max depth comment is 32. So I feel like that's fine. Does update all, that would be nice though.

...38What do I want here? chamlis_ fair, that just makes me a wee bit twitchy
Comment.last.id. Yeah. it's it is a little sloppy but lobsters is so much by far the largest user of the code base that it's not going to break for any sister sites i feel pretty confident about that but so let's say update all and let's just set so i'm doing a trivial update here so yes it does return the number OK, so we will say updated equals 0 while until updated equals 0.

02:15:51Let's say max is 40.

...58All right.

02:16:24chamlis_ and sadly I have to go, maybe back in half an hour
Shameless, I'll probably still be going in a half hour. Nice to see you, though. Have a good one.

...50Well, my migration didn't immediately blow up, which is a nice change.

02:17:12All right. So columns is not a particularly large table in number of rows. It has, I don't know, half a million-ish, but it is a wide table, and it has varying widths because people's comments are varying widths. And we actually doubled that cardinality because we cached the rendered markdown on the comment table itself. So it's going to be real annoying if we have a roughly 60 second delay before I can iterate on this. This looks like it's working. I'm too curious.

02:18:39Let me see progress, right?

...46And then I'm betting that me being impatient or me being curious has left comments in an inconsistent state. Yeah.

02:19:08So that'll take a second to run. Well, we know it'll take about 20 seconds to run each of those. What's this? Use Rails logger.

...31And you know, as long as, Those are going to be faster. Let's just do those first so that I get more feedback. Another 20 seconds for the last one. Then I can do the exact same thing in reverse. I don't know. Not exciting, but I did just want to see this tick along.

02:20:12So this is going to take 60 seconds to put those three columns back.

...41I wonder if I could gamify starting a forum to help people who start forums with the actual hitting the chicken and egg thing. Cause what you really need is, and this is my rule of thumb is you need 40 people who visit every day and you only need about half of those to interact. But it is incredibly hard to form a habit for 40 people. And so as the site creator, you could have a little gamified progress bar that says, well, you better start, if you have a link thing, you better start 10, post 10 stories. Or, I don't know, probably five comments is enough. If you get five comments a day, you're probably in a pretty good place. Maybe there's some ratio thereof. I guess the ratio in my head is more like a comment is worth about ten stories.

02:21:59But it's clearly logarithmic in some way. You've got to have a couple of... Why did that one take twice as long? Weird. So those first two queries that are filling reply count and last reply app are taking a second because they're not printing anything. And you didn't log anything. Where's the fun in that? Let's go look and see if we see realistic data.

02:22:44Let's go. Let's pull a story.

...56Get the Rails server running. So I'm tapping that off screen. Try again. All right. So 19 comments is going to have some depth. Column depth in select O. So I have to rip those out of the query. Yeah. So that's going to be up here. So depth and reply count go away.

02:23:47This scope goes away. Because now those are materialized. So we'll see what breaks for those.

02:24:05Ah, Shamless. Hey, look, I left a... Oh, you're not present, I bet. But I left a comment about the deepest reply. So we can delete. Now we'll leave depth on. Depth permits replies. Fine. Nope. This is right here. So we can just check the attribute now.

...46So get rid of that and get rid of that. twitchtd have a good rest of your day, I'm going to logoff
So there's depth from that one. And then reply count also can go away.

02:25:04Thanks, Twitch. Have a good one yourself. Appreciate you hanging out. There's depth. There's reply count.

...24Delete these out.

...30This just goes away.

...39Doing a little shotgun surgery might even work.

...53So then what was that scope I just deleted, thread attributes?

02:26:03Yeah. You're getting a 500 right now? That's pretty bad. Let me drop what I'm doing and work on that. So let me... All of that should be in good state. Let's save the stash and pull up your error. Thanks for dropping by to tell me about a 500. I don't always look at things. Let's look at the IRC. Okay, so IRC is not blowing up that the site is down. And then...

02:27:11Oh, I would bet nobody can see this comment about there being a 500. Because you have a brand new user account. Twitch is a little paranoid about these things. And so it's just sort of assuming that you're bad. So someone with the username D Clemeth dropped in to say, Hey, I'm getting a 500 while logged in could have to do with my comment here and then link to comment on here. Change the type of a type store field.

...53Oh, you're clement. Oh, thank you. I've appreciated your stuff on the prefers color scheme. And sorry for submitting your last thing. I didn't realize that The GitHub UI has made it really hard to tell whether something is ready to be deployed or not.

02:28:18So you changed the default from false to system.

...35All right.

...42Let's go check prod.

...54Oh, but I can't because it's this type store column that's just a bag of attributes.

02:29:04Let me grab yours, Clements.

...24And I'm going to do that off screen because I don't remember if there's anything sensitive. And there is the GitHub OAuth token. I don't know why that's a setting.

...41Yeah, so I'm going to clear the screen there. Actually, I'm just going to disconnect to make sure I can't scroll up and accidentally show that.

02:30:10No, you didn't take down the site. That's usually my job. The settings are stored in some kind of, it's not quite a string, so I can't actually search these out, but I saw in yours that you have false. I was hoping that I could just select these out so that I don't have to loop over every user, but there's only 100, so, or 100k.

...56I'm just going to force everyone over, I think. Can I? Double check in the pull request. Yeah, there was just so much churn renaming these files that I missed it. So thank you for figuring out what was wrong.

02:31:46OK, so that looks good.

...53Oh, now I've just created migrations out of order. So I'm going to have to, when I pop the stash, just bump that timestamp, I think.

02:32:10So fun fact, that false is actually getting coerced to the string f, because I can see the exceptions. So it is looking for system-f.css. And it doesn't look like it hit too many people. We have a user. We have one user in the database that doesn't meet that validation. OK. Boy, if only someone had made a database product for exactly that problem. But we'll fix it the Rails way.

02:33:04Make sure we're not actually just churning the database for no reason.

...29So, Clemeth, Are you totally new to Twitch? Are you using a VPN? I'm actually going to mark you as a VIP. Maybe that'll allow your messages to appear here. I don't know if other folks are seeing your messages or just me because of this. All right. Now that finished in a reasonable amount of time. All right. Look at that. Why? Why this?

02:34:07What does production have? Yeah, you just registered. Well, so Twitch is hiding your messages because it assumes that you are a ban evader. Are you maybe using a VPN? If you are, you are sharing an IP with someone who got booted off of Twitch.

...55Frici It's only you, their messages don't reach the chat/us
So you have general in production. Yeah. chamlis_ I'm back - stream health seems to be suffering?
Frici also i'm getting buffering CaitThinking not sure if its my end though
So general is correct. I don't know why my local dev is wrong. All right. Let's log out of this.

02:35:16Frici ah chamlis_ has it too
Well, if two of you are seeing stream health problems, it's my end. Sorry about that. Why is this installed? So we're going to add. Let's do this here.

...43We're going to add that and that, because they're fine. And then that's just the branch I was on. And then add that file.

02:36:22Frici vpn would boot them from the chat/not allow them to connect, not shadowban their messages
Frici or at least is what usually happens
Yeah, so, Clemeth, I do still see your messages. I don't seem to have any way to approve your messages.

...33And your messages have a little orange highlight on them that says, Possible ban evader restricted. But there isn't any way to be like, No, this guy is legit. Chill out. I think the... Twitch strategy here is maybe too cynical.

02:37:27Let's stay to my end. All right, so that's undone. That's staged.

...41I don't know where I just did. All right.

...59All right, so Clement, this will take probably 60 seconds to run. And then we have a bunch of Puma workers and they get recycled one at a time. So it'll be up to three minutes or so for all of them to be replaced. That's kind of back of the envelope here. So let's just give it a minute and then we should have your thing set.

02:38:51Why is this taking so long? We didn't change anything here. That's just Ansible. It stalls sometimes. There we go. Now we're at its usual, it takes four seconds to run a command.

02:40:03Okay, so the deploy has finished. So if you climb it, if you want to go ahead and reload, you should see the Well, you know, you start out with a one in 13 chance and then every 20 or 30 seconds that goes up some more.

...47still get a 500 yeah we'll give it a second because it takes a minute for all the workers to recycle

02:41:20Huh, are we down down? No. The uptime monitoring service said we're down, but that's not right.

...46How do you still have an F? How did you get a string f instead of a... ..

02:42:18just gonna have to make another migration or just fix this one and manually rerun it everybody gets new well

02:43:02It's going to be a string. Hang on, if I set it, is it going to be a string or is it going to be a symbol when it comes back? It's a string, right? So I'm looking at your, yeah. So you were allowed to have nil system normal.

02:44:15Just gotta see it run.

...22Now I'm going to just log into prod and do the exact same thing. I'm not really worried that a sister site has attempted to deploy this migration in the last 90 seconds.

...52We are migrating a lot.

02:45:04Because of that default. So if the default was false, let's just make it really have the string. Try that again. It's going to take a second to run.

02:46:07It's clearly hitting every user in the database, which is fine because Probably they had false. This settings thing being this weird serialized hash. Here's one vote for Postgres because it would just be a JSON hash and then we could query on it properly. Instead it's serialized.

...59Yeah.

02:47:08I just don't have enough material to cover this migration that's taking a couple of minutes.

...56I should just call the, I can never remember the names of these. Is it update column, update attribute?

02:48:16Update attribute. But if I call update attribute, It's going to not actually work because prefers contrast as a virtual column. Yeah, I canceled for nothing. I got ahead of myself.

...52dr3ig how about update all to system, and let them change manually :)
Should be next if. dr3ig distributed computing
Next if. You can skip it if we haven't.

02:49:04So the reason I wrote that if is I was trying to avoid touching every single user record.

...59would be nice have a progress bar when I have to write these kind of things.

02:50:08All right, I'm just going to let that run. There we go. All right. So, Clemeth, you should immediately be able to load pages. Can you confirm that you can?

...35He said yes, yay. All right, there's an exciting fix. What was I even doing?

...54Right, because I was literally working on a migration and I was just fighting these. I'm gonna bump this timestamp, aren't I? Yeah.

02:51:36Let's make sure I haven't run them like now I have. I don't remember exactly where we were. So I want to, even though it's going to take a second, I want to drop these columns off and just do it again.

02:52:19Because I want to see it apply cleanly.

...28yeah so I had seen this run anyways clement, thank you for your work on the first contrast stuff I didn't see a nice way to do it, but I like what you've come up with with. Just breaking them out and using includes.

02:53:00Let's stand up for one sec.

...34OK, just something noise happening in the other room. All is well. All right. Schema. Versions are schema migrations. Good. Let's look at the status here. Good. Let's make sure the migration runs. That'll take about 90 seconds.

02:54:24Or less.

...30So it's complaining that Columns I just dropped? I guess those other ones didn't run. All right. Let's get back into a known good state. Yeah, it's... I wish light dark had worked out, because that was a really nice thing, but...

02:55:07But if it's going to break a bunch of browsers and then there's something else on top of it breaking browsers that I'm not recalling because I've been in different code so much the last two hours. Oh, the validation thing. Not even being able to know that we had valid CSS was what really put me over the edge there.

...48vinitkme Hello, Hello!
Looks like we've stopped generating 500s about the color scheme issue, too, which is nice. Oh, hey, Vinit Kemi. Nice to see you again.

02:56:19So that's 624. That's the other one, right? 624, right. And I must have accidentally blown away the first contrast. That's harmless if it runs twice, especially now that I fixed so it's not trying to save every single user. All right, so we'll give that a second to run. And then once that's run, if I can load stories and the test suite runs, the materialized thing is done. vinitkme Every time I see your stream, your fonts are the first thing I notice.
And we're right about three hours, which is how long I usually go for these. So now is a good time to say, hey, if you have any more questions or comments, it's a great time for it. Oh, hey. Yeah, so it's funny. As long as we're waiting on this migration, I'll tell a story. pushcx https://www.recurse.com/
I attended Recurse Center, which is Recurse.com. I mentioned this on a recent stream. It's like a writer's retreat for programmers. You just go hang out and study stuff and hack on projects for six or 12 weeks, which is pretty great. And I paired with various people. And this font is called Inconsolata. And I paired with someone and they kind of like leaned in and they looked at the font and they were like, oh, that's an interesting font. You know, like they didn't say anything, but that was kind of the body language. And I'd seen people do that before. And he kind of leaned forward and he was like, oh, that's my font. I made that. And yeah. in Consolado was made by a guy named, oh my God, I'm blanking. It's Rafe. Guess we haven't kept up. pushcx https://en.wikipedia.org/wiki/I…
Rafe Levine. And he was attending Recurse at the same time. vinitkme Where is your dotfiles?
So he was really delighted to sit down at a terminal and see a font he made. I've been using this for quite a while. I just find it a really comfortable font. My dot files are in the directory named tilde. I do not publish them. Somebody just asked me about this a couple of days ago. vinitkme I used Inconsolata-g for a long time And then I got distracted by fancier fonts
But it's such a project to clean personal stuff out of there and private things or that I've just never wanted to spend hours posting that. I don't know. If I'm going to get a question every day or two about it, maybe I'll actually do it. vinitkme Just publish the font config
vinitkme ;)
But right now, it's not especially an exciting project. All right, so if that wants to work, hey, look at that. Just published the font config. I think I did just my GitHub or my Vim color scheme. Let's see if that's up somewhere.

02:59:50Yeah, so Rafe was a really good guy, actually. Oh, here we go. What do we have? Looks like I did not actually post the color scheme. Oh, maybe it's older. Is there a way to search these? All right, here we go.

03:00:27pushcx https://gist.github.com/pushcx/…
So here's my Vim color scheme.

...35And I'm pretty sure that's up to date. Like this has been hanging out here for what, two years? I don't think I've changed it in two years.

...51Oh, it didn't add the, are we back on this? Test database didn't migrate. Oh yeah, this didn't even print. Well, if it doesn't print, I don't need it. So let's see, where else was I? Yeah, the big project I worked on when I was at Recurse Center was mostly learning Haskell. And I made a solver for a game.

03:01:39What was it called? I don't want to scroll back. A bunch of private repos to find this darn thing. So I'm going to pull it up here.

03:02:00pushcx https://github.com/pushcx/shenz…
There it is. So Rafe helped me a bunch with this. There's a solitaire game that ships with Schengen IO. And Zachtronics has now put this in their solitaire collection. And I just found it a really pleasant solitaire game. It's a combination of nice aesthetics and fairly easy gameplay. So it was just kind of mindless fun for me. And I was curious if what percentage of games are winnable. And So I set up a solver to generate games and then just brute force solve and see if it could get to a winning state. And then I think I blogged about it in my return statement, right? pushcx https://push.cx/return-statemen…
Yeah. I found something like 99% of games are winnable, which I was not winning 99% of games. But it was a lot of fun. And the end of it, I had a bunch of hassles wrapping my head around how to maintain state. And Rafe helped me work through the last couple of iterations on that project. All right, so this looks good. And then I was going to, that's what I was looking for a story ID for.

03:04:08zero one zero one are there no comments zero one i picked a bad story there are no comments that are deeper one zero one zero one not deep enough come on let's find an argument zero one people are using tabs And again, 0 and 1.

...59If I wasn't testing the depth, I would just try to find these with the depth attribute right now. I guess let's try that.

03:05:29Depth does not have an index on it. No comments have a depth. All right, so this bugged. The migration did not work. And it absolutely should have.

03:06:13It's a new one on me now that we have multiples.

...20taimouraaa Hi why dont you use active record and write your own queries
Really, that's not the one I wanted to redo.

...30Why don't I use Active Record and write my own queries? Because this is a migration, it's only going to run once. And because there's a significant performance overhead to, loading all of these records from active record so we have what six hundred thousand five hundred thousand so 550 000 comments in the database and if we have to load them all back so that we can load them all from the database and run them this migration that takes two minutes is going to instead take 10. taimouraaa how much experience do you have with rails. I have like 1.7 years now
And given that I couldn't even write it correct the first time, I will manually revert this.

03:07:49I started with Rails pre-1.0, so I'm somewhere around 20 years with Rails.

03:08:25taimouraaa hmm wow that's a very long time
It's not reply count. It's reply singular. There we go. Yeah. Yeah, it kind of sneaked up on me.

...46Let's see. It has one parent count. And then where did I just add a counter cache on stories?

03:09:01taimouraaa haha :))
It's funny, 20 years with Rails and I can never remember which things should be plural and which should be singular.

...42taimouraaa I don't think you stream very often
This does what I want, right? Yeah.

03:10:18It feels very often to me. I stream twice a week for about three hours each. pushcx https://push.cx/stream
So if you go to... I linked it upstream, but... If you go up here, you can see all the archives and stuff.

...49You know, I haven't actually changed the code, so this is still going to fail, but at least it'll say things like how many records it updated, because I'm curious whether it ran the loop multiple times or zero times. What went wrong here? Because I tried to be careful with the max, but maybe I goofed something there.

03:11:30vinitkme Wow, these migrations takes a lot of time
I almost want to split this into two migrations, just so I don't have to add and remove these columns, because it burns two minutes every time I iterate. Yeah, so because the comment columns are wide, because they have the text of the comments in them, and because there are half a million, it has to do a full table rewrite. And there. is a way to group these so it does one rewrite instead of three. vinitkme Are you also updating tests/
And if I remembered what that was, if you look in our migrations, you might even find it, that you can put the column migrations in a transaction so that they get combined. But I don't remember what that is. I don't care if this thing keeps crawling along.

03:12:35It was fairly recent, too. taimouraaa do you have a youtube channel as well
Come here.

...49No YouTube.

...56But if you want to see the VODs, that page on my blog that I just linked does have the old videos.

03:13:17taimouraaa Yeah i saw. it was taking too long to play
Taking too long to play. I mean, they're each three hours long. I don't know what else you would expect.

...33So the first pass, that's probably everybody reply one.

...49Oh, I get it. All right, so let's start the alter table running while I'm fixing this, because that's going to take a minute. Come here. So this is, it did all the first level replies. And then each one... Yeah. Let's change this. Depth is 0. Depth plus equals 1. taimouraaa what days on the week you stream so we can tune in :>>
If depth is greater than or equal to 40, we will... change that well for me it's monday and thursday but if you are not close to chicago time that may be different for you so we can actually start at

03:15:23So we'll start at one, right? So starts at zero becomes one, then find all the ones that are replies that are at our current depth. No, at our previous depth and set them to the current depth.

...52Looks basically correct. See if that wants to run. So it's Monday afternoons and Thursday mornings. taimouraaa ok grat
taimouraaa great
Go back and look and see if I can find that darn way of combining. Yeah.

03:16:28There it is, change table, bulk is true.

...37And I don't think about it because you've got to have a default for all these things. So that was...

...57So that ought to be good. No, that's wrong.

03:17:11So I still have to do the code so it touches this last reply app.

...28Touch.

...58There we go. That's a lot of functionality for two lines of config on the belongs to. And as long as it doesn't add to us getting more deadlocks in prod, not too shabby. I think we'll be okay.

03:18:24All right, so here we go. Depth one. -oh, depth 2, same number of comments. Yeah, that's not actually progressing. All right, let's really spot the bug. So if you would like to be a channel VIP, just spot what my bug is before I do.

03:19:07Like, how did it get back into the loop without increasing the depth?

...33So this should say, find me all the comments. that are replies where I almost want to do this as the recursive CTE just to be done with it.

03:20:14Well, you know what, Taimura, I'm guessing at your pronunciation there. You got to tell me if I'm wrong. I am going to just do this through Active Record.

...33We're going to do the simplest, slowest version of this.

03:21:37taimouraaa pronounciation is good hehe
dr3ig you should order them by id and set depth =parent.depth + 1
taimouraaa I currently work on a big project and we still use active record
I should order them by ID and set the depth equal to the parent depth plus 1. Dre, you're talking about this previous version here, right? This attempt?

03:22:05dr3ig no, your current attempt
Oh, I see what you're saying. That's a lot cheaper. Yeah, I don't have to materialize it.

...32And I want to... I really want to eager load that.

...42dr3ig in your previous attempt i think you iteratively increase the depth of each comment
So if I said this, what SQL would I generate?

...54dr3ig as in you set the same depth to all comments
Yes, I was. And I knew it was going to be inefficient that way, but I also thought it was going to actually work.

03:23:24Yeah, it's not called parent, is it? Called parent underscore comment. All right, so.

...40Yeah, all right, so it's just gonna hammer the shit out of the database for a second. Oh, well, at least it'll be two. Well, a query for every thousand records rather than a query for every record.

03:24:11Am I doing this?

...42It's a nice strategy there, Drake. Thank you.

...54If the migration ever wants to finish, I'm going to wind up the stream. So if anybody has any last questions, now is a great time to get them in. Especially when I'm literally just watching the migration run. All right.

03:25:36taimouraaa did you ever dabbled with other tech stacks other then rails
vinitkme Are you also employed somewhere?
pushcx https://recheck.dev
vinitkme Do you work on a Mac or Linux?
no i'm not employed so i hmm i used to work for stripe i'm coming up on one year out of there and i am working on this startup so when i was saying snarky things about database integrity and catching my bugs if i was i didn't i didn't see it in both places taimouraaa its linux i think
Just rename that dang thing.

03:26:20Yes, it is a Linux desktop. There was a big running joke. A couple of streams ago, I had a guest who was using a Mac desktop and his That's funny. The three took the same amount of time. Frici someday it will be the year of the mac desktop LUL
His audio kept having weird issues, and mine was actually working totally fine, which is the reverse of what I would expect from experience with Mac OS and Linux.

03:27:04taimouraaa older versions of mac have lots of sound issues
Oh, I didn't change it here. That's fine. I didn't run it yet.

...18Do I want to say update attribute? I do.

...32taimouraaa what do you think is the future of rais
taimouraaa rails
Because then I don't have to say validate false and worry that something is loaded funny.

...50dr3ig can you search which doesn't trigger active record callbacks/hooks ?
What do I think is the future of Rails? I don't know. Drake, I'm not sure what you're suggesting. dr3ig save triggers after_save
And it's update attributes. taimouraaa do you now use LLMs at all
I just pulled it on stream a minute ago. Update attribute name, comma, value. taimouraaa not*
Validation callbacks, updated, and stuff are all skipped, which is what I want. You're a minute behind me, I guess, Drake. You might want to reload because I did have a burst of lag. So Taimura, if you look at that stream archive and look for LLM in there, I did a stream demoing how I've used a coding tool called Ader. I think pretty highly of it. It's got some big restrictions where there's stuff you just can't do with these tools. And I don't know, they're kind of promising. The fact that the copyright is up in the air for the resulting code means I don't use it on any code base I care about, like lobsters, because I wouldn't want somebody else to have the LLM. taimouraaa do you think AI would be able to replace mid junior level devs
clement the github actions run with a fresh database every time i wish i could mark you as acceptable oh you are responding to i bet you read hacker news and saw that post by the guy who runs gumroad right you're really echoing the title of that post That was engagement bait. That guy is full of it. taimouraaa haha its everywhere nowadays.
He wasn't hiring junior developers anyways, so saying I'm not hiring junior or mid developers because of AI is a cheap way to get attention. And vaguely honest. not especially honest yeah i did say in my stream that using a llm tool feels a lot like pairing with a junior developer who is particularly good at googling for things it's not perfect but it's it's pretty good It has changed my expectations and my assumptions around whether I want to make little custom scripts for things like my stream archive pages are fancy because it's easier to do that stuff with the LLM. dr3ig update_attribute doesn't skip callbacks but update_column skips callbacks
But I don't know the copyright issue being open means they're just so dangerous. Did I misread? dr3ig and i think i'm up to date
Oh, you're right, I misread.

03:31:22dr3ig https://guides.rubyonrails.org/…
Well, I'm going to just let this run, Dreg. taimouraaa what tool is this you are using for reading docs
So you're right. And docs say you're right. That one is such a small change that if this runs correctly with the correct data, I'm okay with it. Yeah, this is going to just be slow, but it's not as slow as me revising it a hundred times. pushcx https://zealdocs.org/
So it is zealdocs. There is a Mac OS. It's a close copy of a Mac OS utility that I don't remember the name of.

03:32:08taimouraaa looks great
But it's quite nice. I like it because, well, especially I used to do a lot of development on a laptop. Frici Dash?
And it's nice to have docs on the go. But also, especially now that Google puts garbage at the top of search results, a lot of the times it's just easier and faster to immediately go look up the thing I know. Dash. Yes, Fruity is correct. Dash is the OSX version I'm thinking of. OSX. How old am I? Mac OS.

...45All right. I don't think that takes a lock on the database, does it?

03:33:10I'll find a couple of comments and make sure that the data is reasonable. Yeah. Either that's broken or it's happening in a transaction. And I think it's happening in a transaction. vinitkme Would to love to have a blazing fast LLM just trained on top of my local Dash/Zeal Docs
I do see the field.

...45It says there's some.

...59taimouraaa i dont think it contains javascript docs
Let's look at a couple of comments.

03:34:11I can't load them because the migration is running. I just wanted to see that the right tree is there. And I want to see that there's a couple of replies. So let's... Alright, so here's a couple that are on the same thread.

...43Okay, so 4307 has two replies that are both at depth 1. How is this one at depth 2? If they're both replying, yeah, Drake, we've got a bug.

03:35:10I liked your strategy, but If 4311 is pointing at 4307, one of these is wrong. 4308 is pointing at 4307 and is 1. So it's this one that's wrong.

...35I'm going to stop the migration because it's wrong and it's so slow to reverse.

...50Do you think it's the parent comment preload? I mean, it can make the thing run slower, just

03:36:21I'm not used to dregs code having bugs, so I don't know what to say here.

...35Yeah, so 4275.

...51Hang on, these are not in a useful order.

03:37:00dr3ig :( sorry. i have no idea myself. could it be some concurrency issue ?
And it just messed up the.

...15And I just blew away the data. All right.

...27All right, so 4275 has a depth of 1, and its replies all have a depth of 1. It's the preload. Yeah, it is a concurrency issue. Because I had the preload, it loaded the parents before they had their depth set. So we do have to just hammer the shit out of the database. because ActiveRecord isn't expressive enough to say that I'm setting it to the value. Yeah. Hold on. It can be at least a little faster.

03:38:18Let's make sure I'm doing this right.

...46I'll just pluck off the one field. I wanted to make sure I'm not getting a, yeah. So first, yeah. So then this, come back here and become where the ID is, comment dot, Parent ID, is that actually the name of the field? Parent underscore comment ID.

03:39:35And we will pluck its depth, and then we will add one. How does that look, Drake? So instead of preloading, which is creating the concurrency problem,

03:40:00dr3ig what if select instead of pluck, to have it run in a single query
yeah and the reason that one that two was correct is probably we tipped over the thousand of find each pluck is a single query so if you look at what i wanted out of pluck was to get just the single field back and to not instantiate a active record object if i say select See, I got a whole active record object instantiated, and that's much beefier. This at least is an array with one element in it.

...48I think this is good.

03:41:15so good it fails with a syntax error ah yeah add extra parentheses what are you yelling about prefer pick depth okay yeah I knew there was a method for it I just didn't remember the name nice of standard to yell at me

...46Alright, what's everybody's bet on whether this is actually going to work this time?

...56taimouraaa no
My bet is yes. I feel pretty good about this. Your bet is no? Why no? Just general, it's taken me 19 tries already. I appreciate that pessimism. Or did you see something in the code that looks like BS?

03:42:21taimouraaa just b/c it doesn't always work the first time
Is the pick change bad? Yeah, I mean, it's fair it doesn't work the first time, but this is like the eighth time.

...51taimouraaa but i hope it work
Just overwrote the query. I wanted to grab those same comments I had before. Is it up here? Nope. What was the number? 4275? 4275, yes. Ooh, thanks, fam.

03:43:40I need the.

...59OK. This has not been filled in yet. That's OK. Not freaked out yet because this is still running. And it's done 1,000 records. So when this hits 5,000, we'll have our familiar data filled in, hopefully. Maybe it'll even be correct. Yeah, see? It's ticking along.

03:44:29I know there are some early threads that this is moving noticeably faster. I feel like... I know there are some early threads that did have that depth, especially the lobsters meta thread that's what became the first version of the out page. But let's stick with the one we know. Here we go.

03:45:03How was the very first comment at a depth of three?

...14didn't order them all right so this has a pretty reasonable shape where numbers increase over time oh we get all the way to seven what is this thread

...42Oh, and I can't load it because the migration is running. So we'll just have to keep looking. I keep wanting to load it, right? So 42.75 thinks it has three replies. Three comments say they are the children of 42.75. So that's correct. And they have a depth of 2, 2, and 2. Let's follow that 7. So 7 says it's from 43.18, 6, 5, 43.11. 4.2 4307 307 these all look plausible yeah yeah i think this is it all right so we're at 13 000. All right. Well, I'm going to wrap up the stream because I'm getting tired enough that I'm making more dumb mistakes and my voice is dry. And this will probably run for a few minutes because we're only at 15,000 out of 550,000. Clement, thank you for doing that CSS. I wish I could mark you as visible, Sarah. So it's got an icon that says it's not published to chat, but I don't have a way to say, no, this is fine. Frici understandable, thanks for the stream πŸ‘‹
It's funny, I have like nine buttons that will one-click ban you, but I can't say, oh, there we go. Stop restricting. dclemeth Hello world!
Now you should be no longer restricted as a suspicious user. Clemeth, could you say something again? Frici hey clemeth
Just anything, ASDF, so that we see you. Hello, world. Yes. Okay. So I don't think it backfilled your previous stuff. So that's just going to be lost from the archive. But oh, well, at least it's basically working. All right. Well, Greg, thank you for helping me figure out a working solution for this migration. And then... I will commit this and credit Rahul, who was on stream earlier, because this is mostly his code of materializing this. And if this ever finishes and the tests run, I'll get it all committed so you can watch either the GitHub repo or if you're in IRC, the bot will tell you. Yeah. All right. Oh, I should... dr3ig it's still painfully slow :(
I should wire up that Zulip chat to a GitHub bot of some kind. Yeah. All right, well, thanks for dropping by. taimouraaa it was good stream. learned a few things
Yeah, it's painfully slow, but it's only got to run once, so I don't care. I just don't want to keep fighting with it. dr3ig bye; hope it's at least correct
And that previous version that didn't work would have worked, but hey, whatever, it can just run. Yeah. It sure looks correct. All right. dr3ig do you know whether these querries run in a single db cnnection ?
Well, take care, folks.