Signup for your app every week driven development
Streamed
Merged two PRs: StoryRepository.hottest and tags + categories -> CSS grid. Discussed SQLite migration and redesigning notifications with td, plus checking out the noticed gem for notifications on Caius’s suggestion. Design gripes about ActiveRecord lifecycle hooks; would like to get them out of the codebase except for keeping objects in valid states. Spent a lot of time on hatchbox and db outage, so I’ll have shorter streams for the next few weeks while I work on Recheck.
scratch
topics
shorter streams for the next couple weeks
PRs
StoryRepository.hottest https://github.com/lobsters/lobsters/pull/1617
tags + categories -> css grid https://github.com/lobsters/lobsters/pull/1577
sqlite https://github.com/lobsters/lobsters/issues/539#issuecomment-2964114295
issues
redesigning notifications https://github.com/lobsters/lobsters/issues/1076
noticed gem https://github.com/lobsters/lobsters/blob/master/hatchbox/root-deploy tx caius
title
signup for your app every week driven development
sfyaewdd
post-stream
Transcripts are generated with whisperx, so they mistranscribe basically every username and technical term. They're OK but not great, advice appreciated.
Recording
01:20This is Lobster's.
I'm Peter.
As usual on Thursdays, I am a second late in getting myself sorted out, so...
I kept the microphone thing open, right?
There we go.
Let's fix the audio.
Haha, I remembered this time without getting reminded.
I did it, I just closed it.
All right.
So, Lobster's is a discussion site.
Lobster's is a mailing list.
Lobster's is a community.
Lobster's is a dessert topping and a floor wax.
So if anybody has any questions, let's see.
pushcx Throw questions in chat anytime, or just watch me work on the site. Welcome!
Throw questions in chat any time.
Just watch me.
There we go.
Get that up.
Oh, boy.
I need to merge these stories.
They are clearly the same stories.
Let me just click over and do that.
02:50And I'm going to keep the one that's not a Reddit link. There we go. That's, that's the exciting part of running the site is just little bits of maintenance. So anyways, folks can feel free to ask questions anytime. Otherwise, just working on stuff i want to say there's two pull requests to merge no there's one and no two channels touch this one yeah so let's jump in there oh oh i've got my my topic list i'm gonna have shorter streams these next couple of weeks until oh where's my calendar actually i can't reach it Let's look at the calendar. So here in June. So that's the next two weeks. And the first week of July are going to be all shorter streams. And I'll keep saying this because I know folks don't come to every one. But they will probably be more in the range of 60 to 90 minutes. I have a project I'm cranking on. I just need the time. given that i just spent something like 25 hours over the weekend on the hatchbox migration i feel like i'm kind of averaging it back to the usual because part of the value of office hours is it kind of time boxes me on lobster stuff to like six very direct hours of work and maintenance rather than well honestly it wants to take over my life so It's not that it's demanding. It's just I enjoy it, and it's always fun. So tags and categories to CSS Grid. We'll give that one a second. Sometimes I'm going to do the other one first, because sometimes channels can make these Thursday streams. And if there's anything to talk through, it's nice if she's here. And then this one is... You can tell I didn't get the coffee at the usual time. Typos are high. All right. So this one... Yeah. I really like how... similar this code is getting. It's really... Very steadily chewing through these. This one is the exciting one because it's the query that powers the homepage. It does the same user session token thing. Let's take a look at that.
06:30It's that session token. I feel like there's a way in controller specs.
...56So we've got a cookies method.
07:15Okay. Well, I think, I think I'm going to merge his code and then I'll spend a second hacking on this. Yeah. Just, I don't love that you have to look at this and know that what's happening is he's reaching into the session to set things up to be logged in. Yeah, all right. So this is a clean refactoring.
08:38Where's that method stublogin?
09:31Let's grab that down. Oh, this is Jjgitfetch, still learning my way around.
...40OK. This one I want to be editing on top of master.
...56Good. Getting the hang of Jj. It's nice. Very friendly Discord too.
10:08So let's take a look at this. Yeah. So we've got... Let's see, what have we got? Home page controller, home controller, right?
...56Yeah. And this has the authentication helper.
11:10How does this get included? I hope that's correct.
12:02We'll just do this first one.
...35I don't know if I can just access. I want to say I can, right? Let's see if we can just do the exact same thing that's happening here. All right, so which spec is this? Line 33.
13:05need to find controller helper gotta save that okay and then now if I say stub login as user
...35Good. And if I comment that out, the test should, yes, it's fine. Oh my God. It's fine. You ran standard BIM. Chill. Jesus.
...54Okay.
twitchtd good morning pushcx
Not a good test because this one didn't care.
14:07That's weird. Hey, good morning. How's it going?
...37pushcx https://github.com/lobsters/lob…
If you wanted to talk about the SQLite, we can definitely jump into that.
So to share context in, there we go.
I'll put that in my little scratch notes as a thing that came up.
But for context here,
Really?
Can I not?
There we go.
Started getting that set up.
Okay.
Anyways, Tom, sorry for the confusion of thinking I had filed an issue I hadn't.
GitHub went ahead and, you know, I typed the hash and I started typing fake data and it remembered, you know, and it found the thing that I not save.
Is that why I'm getting on?
Yeah.
So this one should be a redirect, right?
16:09yeah okay so wait i must not have there must have been some nonsense where vim got confused by standard rb and didn't save the test and then i ran the old test why does why does printing the response status after fail the
...41I don't understand what I'm seeing. How is the response successful unless I look at it afterwards? What in the lazy evaluated
17:39Am I running the wrong spec and the line number is changing which spec I'm running? Something like that. 30. Okay, so it's that one failing.
18:15Remember this syntax? No. OK, it was dashy. Why are you giving me a hard time? Oh, because I said n.
...42Two examples, one failure. Why did you run a second spec?
...52Because I gave the name of the context.
19:25OK, so now I'm getting a failure without the puts.
...33I must have been running the wrong spec. Yeah, because I said 33.
...46Where's that green? Thing is, if you get a green dot, you don't know which test you ran. Yeah. All right. that must be what was happening there all right that big distraction aside the stub works okay
20:37You know, this other one is definitely not a stub. This is a, like, actually do the thing.
21:37We don't need separate specs. I understand the value of the one assertion per spec, but it's just so fucking tedious. The value is marginal compared to all of my specs are 20 lines longer, and there's a ton of duplication.
22:12So this one is actually testing something different.
...29What the hell is this story object here? See, it's obvious in the PR, but now that It's merged. These shared data and tests should just be outlawed.
23:35All right. You know, I didn't know this view assigns pattern. That's actually kind of nice. It's a shame that's not the actual API for coupling the controllers to the views as opposed to the fairly strange copying instance variables. All right. Why do you set user to be nil? Let's make sure everything still runs.
24:17Good. I think that matters.
...30Oh, no, it does. He's doing the type punning thing. OK, that's fine. That wasn't obvious to me. Let's be explicit in tests.
25:23Why does the title matter?
...40Kind of doesn't. All right.
26:19This one's not super explicit about what an active story is, but that's OK. If you're going to use it once.
...46This test doesn't care who created it. I should have been so happy to get just a basic smoke test. I didn't read this closer. I would have picked these earlier. That's okay. It's easy enough.
27:45All right. Good.
28:34I set those as by the logged in user.
29:05Get rid of that.
...38We expected this array to not include story 7, which doesn't have a name, but based on the line number. six we know is the hidden store because i didn't bring this back
30:59So let's grab that, and then here. Did I not hit comment? All right.
32:05again
...42There we go. Alright. It took a minute longer than expected, but okay. Alrighty. I guess Tom didn't have any questions about this.
33:04Alrighty.
So then the next thing...
pushcx https://github.com/lobsters/lob…
is Chamlus's PR for CSS Grid on the tags and categories.
And this one, we got fairly into the weeds of writing good CSS selectors, especially with our recently added constraint of wanting to only use well-supported CSS and has, which came up on stream maybe six weeks ago, something like that.
All right.
So let's review the diff, because I know she wrote some commits to provide a clean history.
That is an extra indent, I think.
Or she's indicating that it's inside of this.
34:27That's very, yes, this is a really clean way of saying that on desktop, you see the checkbox on the right because it's very natural to read the label on the right side. and then swap it on mobile. In any case, it's over in the screenshots. It looks good.
35:03Yeah, I like these.
...10And then a lot of these get simpler, which is very nice. And then there's a bunch of noise because basically all these checkboxes get a class, but it is worth the noise to have a reliable selector. The previous version of it, and this is a limitation of GitHub that that's lost, the previous version of it, she had to list, is there a checkbox that has a label in front of it? If it has a, We're not seeing a good example right here in this particular file, but does it have a help text in front of it? Does it have a hint after it? Something like that. I just recall there were three different versions of it, so it was a very complicated coupling. Just saying that these are labels for a checkbox is much shorter. I wonder why she chose the old style hash. I don't really care, but this is one of those, like, I wish ERB had a working linter. Working is a little mean. It does have a linter. It's just very hard to be expressive about ERB because it's string soup. I was just thinking about Hanami. They're doing a big fundraising drive. for Hanami and I was curious. I clicked on guides. Why do I have to click on guide? Where are the guides?
37:07I was curious about their views.
...21They have their love of modules.
...36But then it's ERB under the covers. Okay. So, no improvement.
38:29All righty. There we go.
...56I don't even know what to say about our form. I said it in a comment on Shameless's security post, but I called them like variegated forms, but they've just been inconsistent.
39:28So let's go ahead and merge that and deploy it. Right. So we've got that. And then if I run my new little script, actually wait first, let's make sure I'm yeah, it's fine. Good. I'm in the right place of editing on top of. The merge commit, that's all I wanted Check there. And then here's my new little deploy script.
40:22twitchtd how long was the old deploy (not on hatchbox)?
I could probably tweak this deploy script so that it just doesn't bother polling for 15 seconds.
because these always take like 25 to I think once I saw 32 seconds.
So the old way you would have seen me do it was this command to run the Ansible playbook, but just the tag for lobsters, which is the role for
puma database migrations other user setups and running just this section of the ansible playbook typically took two and a half minutes and then it was more than two and a half minutes because we would be recycling workers and so the site would stall which is inconvenient but then
solid queue since i deployed this puma plugin to manage solid queues when was this yeah may 13 as soon as i deployed this it has a bug so that as soon as
Solid Queue gets the message that it's supposed to restart.
It killed the whole Puma process.
So even though Puma could have done its phased restart and we could have had a zero downtime deploy, Solid Queue was just crashing the Puma process, which was annoying.
And it meant that it took two and a half minutes to run the Ansible, the subsection of the Ansible playbook,
And then 90 seconds of hard downtime where we were throwing 502 because it took a while to boot up the workers and a part of that is.
We probably did not have the correct number of workers, so I had thought that best practice was.
To have like three threads.
three to four threads per worker, and then enough workers to fill your RAM, right?
You know, you pay for eight gigs of RAM, you wanna use eight gigs of RAM.
43:02I saw some public stuff from Nate Berkopec where he said, no, what you wanna have is a number of workers to match your number of processors, and then tune upwards the number of
threads to fill your RAM.
And that makes sense if you think about it, especially with how Ruby concurrency works, which if anybody didn't see rubyevents.org, no, events, where was it?
Yeah, so the, no, these are upcoming past events.
pushcx https://www.rubyevents.org/even…
ruby events.org is a very neat website that collects talks from ruby conferences around the world and is slowly building out a whole history of them ruby kaigi was just a couple of weeks ago and posted their talks online and there is a whole lot about rectors which are a very active part of ruby development and then other concurrency topics as well so
I only watched the talks that were in English, but there was a ton of stuff that was great.
And I watched the English ones because usually I am, like, half listening to a talk and playing a video game.
The Japanese ones, you know, well, if I'm going to read subtitles, I have to be watching closely the whole time.
So... Yeah.
There is some interesting stuff.
that'll be worth it.
I just haven't gotten to it yet.
So in any case, and then the other part of that answer was running the full playbook was something like 10 and a half, 11 minutes.
And that is, that's 10 and a half, 11 minutes in the case of zero changes.
Actually like installing packages or updates or something is time on top of that.
45:21And I think Ansible is just aimed at bigger problems than we have.
If we had a fleet of 200 VPSs that ran WebWorkers, well, it would still be two and a half minutes to deploy the WebWorker part and 11 to run the whole playbook.
And especially if we were
you know, adding 50 a day for the peak time and then turning off 50 and then, you know, from midnight to 6 a.m. turning off another 30.
And so these are getting recreated and deleted all the time.
Ansible would still run in that same amount of time.
And we would be thrilled about it because we have one VPS running in that much time is obnoxious.
So it's just it's funny how much of
FullStacking I don't me to come off like this because I know how this sounds. But this is why I love elixir.
A lot of a topic I have been thinking a lot about in coding is whether things scale down.
46:28Could you elaborate full stacking?
You're not coming off badly.
FullStacking OTP
I'm always curious to hear why you love something.
Is it just that Elixir has that really nice hot patch system because it's on the Erlang VM or?
One-time pad, online transaction processing.
I don't know what it stands for.
47:05FullStacking its a supervision tree
twitchtd OTP is the erlang standard library
Ah, okay.
I didn't know that.
Thank you.
...16So on deploy.
Yeah, this doesn't jump to a relevant thing.
FullStacking in short it deals with processes really well
So when it says patching, does it mean deploying?
Yep.
Patching applications is a one-way process.
Yeah, no kidding.
Times error only points in one direction.
Can make docs.
48:00So how long does this typically take? So say you had a small diff about the kind of size that we see here on lobsters where it's a couple of classes get five to 10 lines of code changed at a time. How long is the compile step and then how long is the deploy step. And I understand that these are, except in cases of catastrophe, these are zero downtime deploys, right?
...35FullStacking it really depends on how you deploy
In any case, all right, yeah, I'll be a little jealous of that.
I spent a bunch of time hassling around to get zero downtime deploys.
Okay.
FullStacking but standard way to do blue/green
I imagine there's a difference between deploying a small site like lobsters and, you know, a telecommunication switch, something enormous and important.
FullStacking not so much hot reload
Ah, sure.
Yeah.
twitchtd ya, hot reload requires more work
And I think a lot of the hassle we've had with Puma is its whole system for phased restarts is not actually well supported because everyone just sort of assumes you're going to do a blue green deploy.
FullStacking the thing is that elixir is statefull
Okay, so i've been saying hot reload and maybe i'm misusing the term I just think of it as the process is running and you are updating and the process doesn't go away, but I don't actually know anything about.
Anything specific about elixir so i'm sorry if i'm.
FullStacking so if you want to keep state you do hot reload
misleading.
I don't know state always kicks my ass.
49:54I can see how that would be less important in the web, which is Deliberately. I wanted to say not stateful, or I wanted to say stateless, but then there are so many things like server push and other ways of holding open a connection and trickling data, like WebRTC, you would need hot reload so you don't lose all your sockets. So interesting. All right, so...
50:34chamlis_ hi-ho, sorry to miss my PR (my root drive did something funky and linux remounted it as read-only)
Well, that's annoying.
Let's take a look at that bug.
...48FullStacking but we also have tooling that auto connects the ws too. So killing connections is not a big deal
Oh, hey, Channels.
Well, hey, that's like our database server that decided not to turn on on Tuesday morning because it had an IO error, which everything has been chill on DV01.
since they migrated us on Tuesday evening.
Everything has calmed down there.
If anybody didn't see that, we had a, no, that's that.
pushcx https://gist.github.com/pushcx/…
Okay, it just named it after the top thing, right?
Yeah, okay.
The way GitHub titles these just sometimes.
So this was kind of the event.
The to-do list ended up at the bottom.
But on Tuesday, we had an outage from like 1.05 to 6.40 a.m. Chicago time.
So more the middle of the day for Europe.
The unattended upgrade bounced MariaDB.
CaiusHardcore Europe had a productive morning 😆
MariaDB got a transient IO error and halted safe.
The downtime detector failed to fire.
just comprehensively.
And then we were down until Hunter texted me, basically, which is why I had the downtime detector is because having my downtime detector be somebody texts me is how we have had other multi hour outages before.
52:28so on tuesday evening when traffic was down digital ocean support migrated the bps to a new physical host and we bounced for that we i think it's all resolved i did a bunch of remediation steps and investigation steps you can see all the details here you can see me griping about the downtime detector because i'm particularly annoyed at it oh hey caius yeah Yeah, I apologize that Europe had a productive morning. I try to prevent that by, you know, having a fun website to talk about nerd stuff. It's been like 24 hours and Uptime Robot hasn't acknowledged that I sent them a bug report.
53:26Uptime Robot, just for context, I should be clear.
Tuesday, Hetrix is the one I was using based on the suggestion of a Lobster's user.
That is the one that failed to fire.
Uptime Robot is what I looked at.
Kaya suggested it.
And then I had a whole bunch of hassles signing up, and it was unfortunately unreliable, which is odd.
I've heard a lot of people like it.
CaiusHardcore They are not what they used to be its turning out :(
I think maybe they just are focused on...
CaiusHardcore There was a definite shift with them a couple years ago where they upsell much harder for plans
large sass and enterprise kind of stuff and so if you go in with the i am immediately signing out for the couple hundred dollars a month plan i would bet everything works swimmingly where they may not have really rigorously tested the if you are signing up at the zero do you actually get the correct flow leading you through all the sign up and to be clear i wanted to pay them because i know all of these things will
require a charge for sms or calling but yeah and i generally think that's great like i actually like when businesses make money i'm an entrepreneur i've worked in startups almost all of my career but you know the startup does have to do the thing that it's supposed to do
And I think that also once you get above non-trivial scale, so like, or not non-trivial, once you get above trivial scale, so like if you have a full-time developer, if you can afford your SaaS to pay a full-time developer, you probably should have
Whoever is doing the work of product management needs to run through your signup flow basically every week.
It is so easy for them to break and there is so much benefit to touching them all the time.
And it's not just manual testing in a browser, it's also as you deploy new features and as you deploy
product changes it is so easy for sign up to slip out of sync and not accurately represent the product but this doesn't have a clever name like sign up for your app every week driven development what is that swaf dd
56:22Let's put that.
Yeah.
You know, if I was Welsh, I would probably be able to pronounce that acronym.
CaiusHardcore Dogfooding I guess, but we usually mean that to be using the app, not signing up for it
I got nothing.
But it looks like Welsh.
...57yeah yeah dog fooding i think of as as actually using it but just you have to you have to do it all the time it's i don't even have a great justification for it it's just when you do it you just constantly catch bugs and weird stuff there's something about sign up because you don't as a especially as a developer As a maintainer, you don't see your own signup flow unless you go and look for it.
57:40CaiusHardcore It's the first thing new people who want to pay you money see - first impressions matter! Super important for SaaS especially
But there's so much benefit for it because it is the first thing people see.
...57so here's this all right yeah and having that experience of uptime robot being unreliable because not just like i can't pay you money which you would think you'd want one thing to be working in the signup flow. When I set up the, Caius already knows this, sorry to repeat it, but when I set up the very first monitor for lobsters, instantly, within like two seconds, it was like, monitor failed, you are down. And it's like, no, no, we're up right now. And I haven't deployed for an hour or two. We are up. This is not a maybe thing. This is something in your very first check broke. Maybe it's DNS, maybe it's HTTPS. I don't even want to, like, I have no debugging details to know, but they did something wrong. And then the very first thing they did was give me a false reading on the site. Like, that's a bad experience.
59:20chamlis_ no non-error page would display that quickly ;)
So this is reply.
...31OK, so that's correct. That's correct. That's fine. This pushover stuff just has to all get, there it is. That's not a path, it's a URL. Pushover has to all get extracted to background jobs. This one's also wrong.
01:00:10And that's it. OK.
...41Push that up. Oh, Shamless, now that you're here, if you had anything to discuss in your PR, we can jump into it. But I really liked where that landed, and I was happy to merge it. And I'm glad that my ideas for ways to address the complicated selector were good. I really appreciate that you called out that complexity. Boy, there's a lot going on here. various forms that the labels can take that was smart thank you and i'm glad my suggestions worked out
01:01:51chamlis_ don't think I have anything to add. thanks for the links to the spec proposals too, by the way, I'll try and remember to keep an eye on those for when I can actually use them some place
Look at that.
Now I am making the deploying the fix now a live thing.
Oh yeah.
You know, it was just, I looked at your selector and I thought there has to be another way to express this, but I don't know that CSS is expressive in this particular way.
It has to, someone has to have thought of this before me.
Honestly, that's one of the,
chamlis_ all of this has happened before, all of this will happen again
One of the biggest intuitions I learned, skills I developed when I stopped being a junior developer was learning to recognize someone has gotten here ahead of me probably and already solved this because it is such a weird, obvious problem.
CaiusHardcore Most problems are not new/novel, build on the shoulders of others' thinking
And learning to develop that instinct was was very useful to me and it it tickled when I was looking at those selectors because I was like you know if I could say this, or I could say that, and then I just immediately found.
Those CSS specs.
That is also a skill that when I am in the middle of like a deep bug hunt, 12 layers deep, that skill does not work at all.
It doesn't fire.
I'm mad at the world.
I'm patching everything.
I'm monkey patching.
I'm editing the prod library.
I don't know what it is.
01:03:31The Galactica model of software development.
If we're going to do Galactica software development, then I guess I get to have a dozen copies of myself.
That would be kind of convenient for development.
chamlis_ no networked computers sounds pretty convenient
And then would we be required to take over the world or take over the galaxy?
Or is that just like an optional thing for Cylons?
No network computers?
yeah unintentionally prescient sci-fi huh god i wish they had written an ending for that show all right so all right so i'm at about an hour four so now is a good time to say if you have any questions about lobsters the site or anything you can throw them in the chat anytime
Otherwise, I'm gonna go through PRs and issues and roll out in 60 to 90 minutes because I am working on a big project this next three weeks and I need the time, especially after putting a whole ton of time into the Hatchbox and database stuff from Friday to Tuesday.
01:04:59pushcx https://github.com/lobsters/lob…
CaiusHardcore I wonder if agent-driven coding will make patching everything worse, rather than stepping back and trying to find another standard/approach thats been trodden before - its easy to let the LLM generate more stuff
twitchtd still here
Tom if you're still present i'm looking at your comment on redesigning notifications and here's the link for anybody else.
01:05:15I guess what i'll say i'm going to say this and type it just because I want people to be able to see the public record so sorry, this is going to get redundant but.
...32yeah as you can see my i'm pretty vague up here this is sort of an outline of what notifications do and kind of sketching out that there's a matrix of you know rows of things to get notified and then columns of channels people get notified and it would be nice and it's more complicated than that because there's like People want to be able to say, I want an email for all of the replies to my comments. But then they also want to say, oh, but not that comment because that one got spicy and I'm just done with it and I want to walk away. And if they can do that, that would be very nice. And I'm aware this is a surprisingly complicated thing set of features especially once you get into like nesting things and it's funny because notifications feel very small but they're really not so tom one of the things that's really exciting to me about you volunteering to work on this is I know you're a fairly senior developer. So there's a lot here to flesh out. And I think you would be really well prepared to plan this out. I see your sketch of subscriptions and channels.
01:07:16I think this Like I can't build the whole, like in my head I'm playing computer and building the schema. I think this gets us all the features we want at first glance. I can't quite see it, but we're there. I guess the only thing, yeah, maybe the only thing I left out of this comment is it would be nice to have at least as many features as Reddit because they actually have a pretty good set of features. And Blue Sky is also pretty good about notifications where you can say, like, stop telling me about this comment. Yeah.
01:08:30CaiusHardcore Have we thought about integrating something like the noticed gem?
I don't know the notice gem.
...39pushcx https://github.com/excid3/notic…
Let's share the link.
01:09:04That sounds like a lot of features that we have individually installed. This is a...
...22So I've never heard of this notice gem until 30 seconds ago.
twitchtd never heard of noticed
And I'm always generally a little suspicious of gems that do
twitchtd it sounds cool
like major features but this sounds like they're hitting all of the stuff that we care about and a bunch of features that are related like because i can see how they think of publishing to various group things like we support
mastodon which is basically the same as blue sky it would be nice if we got that out of the box bulk notification see this is really interesting because our notification logic by virtue of being homegrown is kind of buckshot throughout the controllers and models
oh tom there's one design feature i haven't mentioned which is relevant to both notifications and sqlite which is lobsters uses the active record life cycle hooks for a bunch of things and i am grudgingly okay with
before validation hooks or after initialization hooks to kind of course the object into a valid state.
And I basically hate every other use of active record lifecycle model hooks, like any kind of after save or before save, except for the specific thing of, because I hate that models hang around in invalid states for ages.
So like I can see a before save that's like,
twitchtd ya, the lifecycle hooks are a footgun if you let them be
would be a validation but instead it just sort of cleans up because it knows it can shove the object into a valid state i'm okay with that but like an after save hook that touches some other record they drive me up the wall and so to give a specific example if i as a developer or i'm sorry if i as a moderator delete a comment
The comment gets saved and then an after save hook looks at the edit that just happened and says, does this edit look like a moderator did this?
If so, let me create an entry in the moderation log and message the user.
And I hate it.
I have occasionally foot gunned by like bulk editing records and either not sending those or sending those when I need.
It just...
should probably add a layer of service objects for these kinds of business chores of edit comment with log edit comment with notifications that like that kind of thing as opposed to just happens magically and implicitly so as you look at notifications please don't add a ton of hooks because
I just don't trust them for load-bearing infrastructure.
I'd rather be explicit.
twitchtd got it
And as they sabotage you on SQLite, please know that my default is almost always to try to find ways to delete them.
It has never risen in...
urgency and pain high enough for me to take it on as a refactoring compared to, you know, user visible features.
But it sounded interesting.
It sounded like it was useful when I kind of like brain dumped how I don't like migrations and I don't want, I mean, I like migrations.
I don't like maintaining migrations.
And I hate that strategy of create your database by running all your migrations.
No, no.
Why would you do that?
twitchtd lifecycle hooks remind me of db triggers which I also actively avoid if I can
CaiusHardcore Who does that?! Not even the rails docs guide you to that, schema load & seed for blank database
so yeah db triggers i have the same feeling but then also they're even harder to version
and so i have more problems okay i came here to look at this little activity graph guys this looks like a really
twitchtd the sqlite migration will require db triggers most likely for the FTS since those indexes aren't automatically maintained
promising gem to consider.
I mean, it would be a big refactor to touch our notifications, but we could probably bring them in incrementally, but it's nice.
Caius, I don't know.
I have seen a bunch of folks do it, and I think Rails docs, if they now say to schema load, that is a recent change.
And when I talk about recent in Rails, it might be five years old because I don't reread the intro docs very often.
01:15:29Yeah, user preferences.
So it's got a nice hook so that we can say, you know, does the user have a subscription or...
This is a little...
CaiusHardcore Looks like the docs started mentioning schema:load around 6.0, and then become much more explicit around 7.0. Didn't realise that wasn't explicit for so long
odd that it has two versions all right that's fine oh yeah yeah that kind of thing where it's not it's maintaining internal state
Actually, no, that's a really bad way to put it.
That's way more general than I mean.
I'm okay with database triggers as a, like, there is some amount of background maintenance that needs to happen rather than it touches anything that might be visible to a field a developer cares about.
Ah, okay.
Well, Caius, there you go.
Oh, you're beating out Chamlus for the researching random stuff I ramble about faster than anybody can follow.
Yeah, so like I said, to me, it's recently in Rails Guides.
CaiusHardcore I'm waiting on CI running for my bugfix ;-)
CaiusHardcore (Not lobsters)
And I've heard people talk about it on podcasts where they're like, oh yeah, I had to update my migrations and oh, we have four years of migrations and maybe I should squash them down in some way.
And I'm just like, oh my God.
Yeah.
This notice gem looks really good.
So Tom, if you wanna give it a good evaluation.
01:17:36twitchtd I guess subscriptions aren't handled by this gem right, it's just for notifications?
I guess we would have to add IRC and Mastodon, but, you know, as long as there's a, what do you call it?
As long as there's like a generic hook point, we don't even have to worry about pushing it upstream.
Yeah.
The impression I get is they don't talk about subscriptions, but they do have a general purpose place for you to put a predicate for user preferences.
So they say user preferences here, and I read this as we would write, well, I would prefer we do it as before in queue, because why make a job that isn't going to do anything?
And that would be where we would do
Check to see if the user subscribed.
Okay.
Fall back to what their preference is.
And that gets into your channels and subscriptions models.
I want to peek at the activity graph on GitHub here after I finished skimming the readme, but this is quite nice.
Oh, clever.
Oh, one thing on full text index and I guess also notifications is with solid queue, we're now in a really good place to more pervasively use background jobs.
And I have an issue open about it, but also it has a very nice support for
recurring tasks so if you're not maybe we don't want to do a database trigger maybe we just want to have a a recurring task or maybe we want to have a job level so we don't have to you i guess what i'm saying is we don't have to use the sqlite database triggers it can be a on the rails side we save the comment
And then we enqueue a job for out of process rebuilding the index so that the search engine is up to date.
Or maybe for comments, we do it as a recurring job that runs every five minutes or two minutes.
twitchtd true, db triggers aren't required if you don't want them
But for stories, we do it as a background job because we get 20 to 30 stories a day and 250 comments a day.
So anyways, we have options.
We have actually really good options and I would like to make more use of background jobs.
My only concern with database triggers is install and versioning.
It has to be possible for them to be automatically installed and configured right at provisioning and then
pushcx https://github.com/lobsters/lob…
somehow whatever the trigger is it has to be it has to appear in the repo it has to be in the code and it has to be part of the deploy process that's why i spent a whole bunch of time rigging up this this comment i rewrote this comment in this script a bunch the first version of it included a curse in each one of these but
essential code has to live in the repo.
It can't live just in the database.
There can't be any manual setup.
That's really my only concerns about database triggers.
And as long as that works, I am a happy camper.
01:22:03Okay.
...19I know this username.
What famous thing?
Oh, he's the Hatchbox guy.
Well, speaking of... Hatchbox?
CaiusHardcore Oh yeah, I think noticed came out of GoRails
Well, that's actually really promising, because I mean, I trust him enough to take a dependency on him for deployment.
CaiusHardcore Forgot that link ha
And this level of activity where there's the occasional spike, but just fairly low regular contributions looks really promising to me, because I don't want a dependency for a key feature that churns too much.
And I don't want one that's abandoned.
So this looks really nice.
Okay, so yeah, we got this period of, so like every 18 months to two years, they do a major refactor and then otherwise things are pretty chill.
Cool.
Someone clearly has a, on Fridays I work on open source kind of schedule and it used to be Tuesdays or Mondays.
Funny to see people's weeks like that.
01:23:43Yeah. These are all normal, healthy graphs. I bet if I line that up against major versions of Rails, that those charts would fit very closely. So anyways, promising. Did I... I didn't grab the... See, I got to put these things in chat and in the.
01:24:19All right.
So I'm going to finish up this comment and then run into the, you know, call it on today's office hours so that I can get back to my big project, which is, it's not
pushcx https://recheck.dev/
secret it's this has been hanging out recheck.dev is the personal project not personal entrepreneurial project it is an open core library that i've been working on and i got very badly delayed i wanted to have it out literally like a year ago this month life happens i would like to have it out this month
So I am trying to put a lot of time into this.
And after spending 20 to 25 hours on the deployment and database stuff this weekend, I feel okay averaging that back out with office hours.
Oh, and if you would like to beta test,
CaiusHardcore Heh. Previous place had a similar sounding tool called Health Robinson
recheck because you have a team of say one to four full-time engineers and a database with a million ish or one to ten million records in it i would love to have some beta testers i can offer you like a free six month license you got to be pretty forgiving for the first minute but i will be looking for folks in about two weeks so please do join the
mailing list if you would be or just message me if you'd be willing to be a beta tester yeah you know i talked to developers about recheck and like 19 times out of 20 i explain what it is and i give an example or two and people are like oh that actually sounds pretty darn useful oh i can think of a bug that i would have caught with this and i can like see them starting to write their first check in their head and then one time in 20
people say, Hey, we have a crappy version of that.
And we call it double check.
We call it verifier.
We call it integrity.
We call it health Robinson, which I don't get the pun.
Is it like the Castaway Robinson?
so if you have a second, please explain whatever that word play is.
CaiusHardcore British cartoonist, used to invent whimsical complicated machines that usually involved knotted string holding it all together
And I say crappy because they always say crappy because it is nobody's full time job to maintain a version of this system.
So I would like it to be mine.
British cartoonist.
Oh, oh, that guy.
Ah, in the States, we call those Rube Goldberg devices.
But yes, I've heard that name now that you say it.
Where's the...
01:28:23It's your GitHub username. Okay. Spelled out.
...48Yeah, just put is fine.
01:29:44I hope that comment is reasonably clear.
...51twitchtd thanks
Cool.
All right, yeah, so I'm going to wind up this stream.
The next scheduled stream will be...
monday morning at or i'm sorry monday afternoon chicago time usual 2 p.m but again that will be a shorter 60 to 90 minute stream and i don't know we'll see if if recheck behaves and i can hustle through where i'm at now i would like to do the regular stream but only so much time in the day
chamlis_ thanks!
Alright, folks.
CaiusHardcore Thanks!
Appreciate all the contributions.
Fun chatting with you all.
Hope to see you on Monday.
Until then, take care.