If not OSHA, the Hague
Streamed
rel=βugcβ bug fix. Caches link style. Caches links offscreen. Implementing Russian doll fragment caching for mod activity page. Fixing a JavaScript bug that broke upvoting. Extracting username history for comment rendering. Hosting costs and SQLite migration plans. Git vs. Jujutsu version control.
scratch
topics
PRs
bug fixed: rel="ugc" https://github.com/lobsters/lobsters/pull/1749
fix caches link style https://github.com/lobsters/lobsters/pull/1753
issues
cache links offscreen https://github.com/lobsters/lobsters/issues/1752
fragment caching on mod activity
cache activity table elements
cache entire table
confirm js timestamps
username - extract, backfill
title
If not OSHA, the Hague
This page has no sources
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
02:02There we go.
Okay.
FullStacking Good morning sir, ready to start your day as a elixir dev :P
Probably helps to unmute the correct devices.
FullStacking lol
Hello and welcome to Lobster's Office Hours.
FullStacking jk
This is Lobster's.
Oh, an Elixir.
Well, inconveniently for you, Lobsters is written in Ruby.
So... Oh, you're saying I'll be an Elixir dev.
I mean, we'll see what happens with Ruby Central.
...48FullStacking ruby central ?
pushcx This is Lobsters office hours, ask questions anytime
So, yeah, let's throw the message in chat.
FullStacking ah
this is lobsters office hours ask questions anytime ruby central is a non-profit that maintains some ruby tooling like
bundler and Ruby gems, which are, it's the tool for and the repository of Ruby libraries.
FullStacking yeah I bet.
And they've been, they also run a couple of conferences, and they've had a very rough last two years.
And for more on that, I would direct you to the Ruby tag on the site.
Because we've had, I think, four big merge stories each of the last four weeks, you know,
or rather that's one story per week, the last four weeks, but it's been, it's been a lot.
And if I started getting into it, like there goes three hours, I don't actually have anything to contribute because I'm only involved downstream as a user.
So kind of staying out of that one.
Yeah.
I run this website, Lobsters.
We can talk about anything on the site, any kind of moderation stuff or how the code base works.
Just when folks aren't asking questions, I use this time to work on the code base.
FullStacking What is the review like to get an invite to lobsters?
And I think I just merged a PR here.
Yeah, I think this is after the last stream.
What is today, Monday?
So in the last stream...
I never know which way it's going to round it.
pushcx https://lobste.rs/users
The review is, you can look at the list of users, slash users, and just ping anybody you know, which is kind of a lousy process because you just have to be like, let me think of all of my friends' usernames and control F each of them.
Does Alice have an example?
Does Bob?
Oh, there's someone named Alice Bob.
all right that's no fun there is actually an open issue about that where is it something about the tree i forget the issue number because i haven't thought about it for a year or two but one of the things i would like is so if we go look at the production site
Peter has linked his Mastodon account.
And I would also link my Blue Sky account if it were possible.
When people link accounts, it would be very nice if random users could type in their own username on Mastodon or Blue Sky and see, hey, who follows me on those social networks?
Can I say social?
Is that where I find it?
Maybe I mentioned it in here.
06:05Maybe not.
Anyways, it would be great if someone could go ahead and use those social networks to find an invite.
pushcx https://lobste.rs/chat
The other, the easiest way other than that, if you don't already know somebody who knows you, is to drop by the chat room.
And folks will usually ask for, hey, do you have a GitHub?
Do you have a personal blog?
Does it sound like you're going to spam anybody, like you're just there to paste links?
If you hang out for a couple of minutes and you say something reasonably interesting and calm about any of the links or conversations that go by, an invite tends to be pretty fast.
07:02FullStacking Thanks for that. Speaking of bluesky have you learned much about PDS servers and the ATProto? I've been building a PDS server in elixir. I only ask because the whole pds server seems like the way the fedivers is going over activity pub.
i honestly don't remember if i did this one on stream or not but fps vogel who has fixed a bunch of things fixed this bug which i guess was sort of mine because i wrote some of this code but i sure didn't remember it but this was a nice one
...34Just throwing it in the show notes.
So that got merged.
So I don't know anything about PDS servers and App Proto.
And I follow a bunch of developers on Blue Skies, so I see it get mentioned fairly regularly.
But I have no idea how that all fits together.
FullStacking do you know about activity pub?
And it all seems reasonably interesting and well-designed.
But there's just only so many hours in the day to learn things.
FullStacking its a competing idea
that has not made the cut for me no i also don't know activity pub which is funny because i wrote our did i write our mastodon integration i think i did it was mostly based on our twitter integration yeah yeah i have a both accounts on blue sky and mastodon and i've pretty much
tailed off of using mastodon entirely because it's so clunky and just buggy you know for a social network that's like it's not part of my job it's just a for funsies thing if the client isn't very nice to use i'm not gonna use it
And that's both in what's the actual UI, but also what's the moderation, what's the culture.
09:14So this one is affixed to something I know I merged last week.
...26FullStacking Long short, PDS personal data server. the idea is everything think you post, is stored in a very generic json blob on your own server and federated to the social networks via relays / proxies. Its the whole how you own your own data in the social network
easeout the default mastodon web client is crummy. I've had a good time with Mona.
Yeah.
Everything you post is stored in a very generic JSON blob.
...44Yeah, ease out. Every time I mention that Mastodon is kind of painful, somebody mentions a client. I have not heard of Mona. That's a new one.
10:00What platform is that for?
...12That's a little brittle.
...21This was already getting a little complicated.
This is very specific.
bok0non thats some css if ive ever seen some
And we've already had, so what this is doing is that caches link, I know it has the name archive underscore.
easeout apple platforms afaik. focus on plain ui and lots of a11y options
We used to use the word archive, but people thought it was a verb, and so they didn't understand what it was for.
Now that it's caches, we haven't, it's been maybe nine months, a year.
Hey, Bokanon, yeah.
...55FullStacking if you get free time this is probably the best write up on the ATProto / PDS stuff I've seen for noobs. https://overreacted.io/open-soc…
Well, accessibility options comma lack thereof is my big hassle, so I will take a look at it called Mona for mastodon kind of a squarish infinity sign for a logo.
i'll take a look at it.
11:14I will give that a read later.
But thank you.
yeah so.
easeout np
And it's the four, it's also coupled...
It's not just that it's coupled by name, it's that it's coupled to a name that doesn't match the link, because we've been experimenting with that one.
That seems like a lot.
Caches as labels with a four attribute.
And something I don't think FPS Vogel has caught here is that this is actually only two different kinds because of heinous inline partial duplicating things.
12:43jesseractly Good afternoon and Happy Canadian Thanksgiving!
Oh hey, Jess Rackley.
Oh, Canadian Thanksgiving.
FullStacking you all use that Russian nesting doll partial caching?
You know, I always think that Canadian Thanksgiving should be after because my mental model for Canada is it's like America but colder.
So it always feels like it should be later in the year, but instead it's early.
Shows what I know.
13:07easeout the cold comes sooner, perhaps
and we do not use any russian nesting doll partial caching but it is literally the next thing on my to-do list after looking at prs and issues so yeah prs and issues i would like to add it for the first time until the addition of solid cache about a year ago we
have a full disk cache that mostly works and is an enormous part of our performance story but have never got into the fragment caching because really it wanted something like redis and i could not manage to get redis stood up in our environment and configured anyways
14:27jesseractly Honestly, it's one of the few things that really messes with me about living here.
FullStacking I think it also works in memcache too
graefchen Heya limesHi
Yeah, not seeing French on packaging instead of Spanish.
Yeah, and the thing that's a big improvement for us about solid cache is because it backs to a SQLite file, we don't have to install and manage another process in production.
And until fairly recently,
we were using Ansible to deploy and provision the site.
And it's not my favorite programming environment.
FullStacking you dont like yamls .... jk
jesseractly My team lead was complaining about Halloween stuff in the stores early and said, "at least wait until after thanksgiving!!" Apparently I had such a weird look on my face that she was just like, "Canada, Jessa" LOL
And we were kind of, I think the, what's the outage term?
Like we are in a partially degraded state.
That was our Ansible setup for a couple of years there.
We started using Hatchbox and it has out of the box support for like I want a Redis or a Memcached alongside.
it's that solid cash is just in ruby and no hassle yeah yeah down in america the the goth kids hold the line on christmas
15:53FullStacking Tim Burton's Black Friday
And then I guess Thanksgiving holds the line on Halloween, although... Actually, all of the... No, I'm swapping it around, because in the American style, I was like, wait a minute, I was just out walking in the neighborhood this morning, and the neighborhood is full of Halloween-y stuff.
16:19With, ..
Who's that song?
The Black Parade?
March of the Black Parade?
FullStacking the cure?
They're one of those really romantic, high-strung emo bands.
FullStacking lol
March of the Black Parade.
My Chemical Romance.
There we go.
I was thinking of My Chemical Romance.
One of those bands for the youths.
17:00Thank you.
18:14Is it font weight or is it text style?
I never remember.
jesseractly The French packaging was a little weird, but mostly because of the law where each language has to have an equal amount of space sometimes they'll have the front of a box of crackers in English and the back in French
Font weight.
No colon.
19:24FullStacking Honestly kind of glad to know see bootstrap or tailwind
FullStacking not see*
Yeah, I mean...
...50So lobsters is only about... 14,500 lines of code. And so I'm really reluctant to take on any dependency that's A three digit percentage of our size even high two digit percentage of our size so like adding a gem that's 6000 lines is like really that much. And obviously we have some big ones like markdown but.
20:21Anyway, French packaging yeah. I didn't realize that they had to have equal space. I'm kind of like mentally reviewing the, because some of this stuff shows up in especially the northern states in the US. Yeah, I guess I do see French get equal size. I never noticed.
21:22WhiskyFueled42 hey, hope you all are doing well
jesseractly It's mostly because of Montreal
montreal that's a nice city that and quebec were neat it came up on stream i don't know maybe four or five streams back but that puts it like two or three months back because i was traveling so much but there's that that new high-speed rail that's going to come in through what is it ottawa montreal quebec
And then, of course, Toronto on the west end.
That should be very neat.
FullStacking we getting one from BC to LA I guess, thats if trump didnt kill it already
Okay, so then this one left a conversation off stream.
This one is a stacked PR.
This one is waiting on an ARCH package.
Let's see if the package is ready.
22:22I couldn't tell you, and we generally don't do too much politics on these streams. Ooh, there we go, there's 347. So okay, I can go ahead and merge that down.
...36I don't know if that showed up, but that was the cat who would like me to give up streaming and play with him, but I was just playing with you, sir.
FullStacking I was just saying it was already approved , but I've not seen anything on since
I thought it might be cool enough that he was gonna come and hang out on camera, but no, he has decided not to.
23:04graefchen Trains are nice. Need to take one tomorrow to get to University again. limesYay
twitchtd hi pushcx
Yeah, I couldn't tell you anything.
Those kind of big construction problems kind of move under their own inertia.
jesseractly Here kitty, kitty
Oh, hey, Thomas, I was just talking about you this morning because I was thinking about the SQL light pull request that you've been working on.
Yeah, so the cat is Raz and folks can dig back in the stream archive because he has appeared.
And put in an appearance, a few times, but honestly not as many as when I expected when I started streaming because you know cats that kind of.
choose what they want right so caches this one's a bug.
design.
And then that's already in progress, we just looked at that.
Cache's drop down menu is off screen.
Oh yeah, I had this conversation with the submitter in the chat room.
ζθΏͺ Hi Rubist kurosa75Call
And where did I talk about it?
Howdy, welcome.
pushcx https://github.com/lobsters/lob…
Yes, it is Ruby code here.
Which you can see if you see the the github URL you're very welcome to check out our whole code base and start making pull requests, I have left you plenty of bugs that you could fix.
FullStacking apox how much resources does the server require to run lobsters?
let's say there's an issue about.
25:16pushcx https://lobste.rs/about#trivia
FullStacking I know I've seen it around as late as 2016 so that db has to have some size to it by now
the server so if you go to slash about pound trivia you can see that we are on three virtual private servers oh the database yeah we're i want to say there's around seven and a half million rows in the database now
bok0non whats that, like $50 in hosting?
so it's not terribly large as websites go but yeah we have one big thing for the web server an identical vps for the database this is literally because i tried to size up the maria db server and i clicked on the wrong one and then i sized up the web server and digital ocean makes it really easy to increase the size of your
twitchtd were you talking about anything specific for the sqlite pr?
servers all you have to do is like reboot reboot and it's on but you can't actually turn them down and so it's just like ah whatever we'll be over provisioned for a while it's cheaper than you know taking the down time and rebooting it but we're in my head it's all the expenses for lobsters are the domain the backups
twitchtd I'm going to europe until thanksgiving
three vps's and hatchbox and i don't think we've even hit a hundred dollars a month yet i want to say hosting is in the 50 to 60 range and twitch td here no i was just talking about your your timeline that we it's kind of on hold for the next six weeks or so until you have more free time which is totally fine i am just trying to communicate timelines because
This isn't a whole volunteer outfit.
Nobody is in a hurry.
Nobody is getting paid.
Nobody's boss is going to yell at them.
Oh, well, I guess you mean American Thanksgiving.
We were just talking about Canadian Thanksgiving being today.
graefchen Where in Europe? limesLurk
Anyways, when TwitchTD's pull request lands and we move over to SQLite, I will just turn off this server, the MariaDB one, and that will roughly cut our hosting bill in half.
and we will probably still be over-provisioned.
Which is just such a cheap way to scale.
FullStacking whole db going to sqlite?
It's like, I can spend 10 hours on this, or I can spend $4 a month.
27:58pushcx https://github.com/lobsters/lob…
Yeah, so that's $5.39, I believe.
Look at me.
So you can read the whole history of this issue and...
FullStacking wow
Why, and what we're considering and then.
berkandev I have an issue with how much stuff coming from lobsters /top rss. I don't know if my expectation from it is wrong, but I unsubbed it from my reader
thomas's pull request is open and I don't remember its number off the top of my head but it's linked somewhere towards the bottom.
28:33FullStacking thats a first I've seen a major prod go to sqlite
You have an issue.
BirkenDev, is it like sites that should not be on top are showing up on top?
We could double check that query.
Are you saying that the site is too active or are you saying that we have a bug?
29:06And Big Sur.
...19graefchen Is lobsters really that mojor? limesHmm
berkandev by issue I mean like gripe I guess. Rhere are like items coming to rss with barely any upvotes and 1 single comment. My expectation of /top would be more than that?
What's that other HTML5?
What's that?
It's like a modal dialog.
Yeah.
javascript should be used to display the dial i don't want javascript though does the dialog element work without javascript does anybody know offhand
30:07Yes. Maybe. Hold on. Cat needs attention. I got to mute for a second.
...35FullStacking opened on Aug 30, 2018, dang
All right, cat just needed his belly scratched a bit.
FullStacking thats been a moment
So I wonder if that... Yeah, full stacking, we have a pretty relaxed pace of development.
And my actual to-do list is like 300 items long that's not even up on the open feature requests.
31:04Does this see it actually has JavaScript?
...28twitchtd @FullStacking note that sqlite support is a work in progress, still needs lots of testing and proof that it'll work. If it turns out that there's a blocker for sqlite I think the fallback plan is to instead migrate to postgresql.
Yeah, Twitch, I keep calling you that instead of Thomas, but yes, Thomas.
has correctly summarized it, that it is possible.
We're going to have to do some performance testing, but it is possible that SQLite won't meet our needs.
32:05FullStacking I would love to see the bench on 7mil rows
could use the checkbox hacks with dialogue the checkbox hacks is exactly why a dialogue depended on details this sounds like they've created a yeah
...35FullStacking I've been playing alot with dbs as of late, my most recent fascination has been column based dbs such as clickhose
so full stacking one thing that's a little bit funny about lobsters is especially because of the invite system even more than most sites we are read heavy so we use a full page cache which is uncommon enough that it's been kicked out of rails like 15 years ago and it's gone unmaintained in the last two or three so
Now I'm starting to get nervous about it because it is a key action page action cat.
They call it page.
bok0non dhh too busy building omarchy now
pushcx https://github.com/rails/action…
A shame rounds action pack page caching.
FullStacking Ive seen dual postgres dbs one that is synced for reading and the source of truth for writes
Yeah, here we go.
33:40FullStacking seems to be a good strat for read heavy systems.
Yeah, so this has been unmaintained for four years, which is, ah, that's getting nervous.
...51I would prefer not to have to be in charge of this plugin.
35:18pushcx https://github.com/lobsters/lob…
Ease out if you're bored.
I know you like fixing CSS bugs.
This one's a CSS bug.
FullStacking my active record is rusty, I forget can you have many adopters in a single rails app. IE two dbs in one system
SQLite can also do that kind of multi-setup.
And I'm not enough of a database guy to even remember what that's called off the top of my head.
...49Yeah, you can and we do. That's part of how Solid Q works. So if we look at my... Actually, let me double check. I'm not gonna show a password because config. Yeah, this one's just local stuff.
36:20Oh, actually, you know what?
bok0non are you running hyprland?
I don't even have to pull it open locally.
So if you go in our code and look in the lobster directory, there is a sample database.yaml.
And it shows you that we have like a primary database, a cache database, and a queue database.
No, I'm running X windows, not hyperland.
I'm actually...
FullStacking Do you annotate active record to say which to use?
really really slow to change my desktop environment so like my wallpaper is the same wallpaper I've had for oh god gotta be like 15 years now no longer yeah maybe 20 years now the wallpaper and you know I changed my window manager once about 15 years ago and I don't want to think about that again full stacking the model does yeah
FullStacking ok makes sense
FullStacking I use arch btw
FullStacking lol
so if hyperland is the thing everybody has to use i will use it but it'll be a kicking and screaming two years after everybody else migrates just because i don't want to update the config files and find a new window manager and all whatever that all kind of thing yeah i'm also on arch and so i keep packages up to date
FullStacking I lied on on cachyOS but close enough
Because I find that that's less painful than only doing that every two or three years and then having a ton of stuff break.
But I don't want the desktop to look different.
And I don't want it to be flashy.
bok0non how do you like cachyos? been thinking of switching from omarchy
FullStacking Honestly I'm happy with KDE plasma
Because if I'm noticing animations and new backgrounds and fancy borders on windows, it's just distracting me from the thing I'm actually doing.
All right.
So that's actually all of our open issues and all of our pull requests.
bok0non i would however use hyprland because i really enjoy it
Cool.
Or at least our new issues.
38:37FullStacking I love cachy, they even have a custom proton for steam preconfigured
What do you like about Hyperland?
I didn't link that cache thing.
...51For me, whether it's x.org or xlibre or something else is way below the waterline of the level of detail I want to be concerned by.
39:18FullStacking they also have a nice tool for auto update for pacman / yum
bok0non im honestly not deep enough into arch to have tried all alternatives, made the switch about a month ago and just really like how fast i can organize my windows with it
so we were talking about russian doll fragment caching that is the thing i want to hack out on stream but folks can feel free to throw questions in the chat anytime and we'll just distract into them i have a little script for updating it just runs you know s-y-y-u and
Shows me the diffs for AUR packages.
Nice.
pushcx https://awesomewm.org/
Yeah, this is the awesome window manager.
I guess it's shown up on stream here.
chamlis_ howdy all, hope things are well
FullStacking Ive seen a huge jump to arch since arch install.
And a very custom theme because I've just kind of cut everything out of the theme.
You can't see it, but I do have a little menu bar.
Hey, Chambliss.
veqqio Hey!
How goes with the secret project?
FullStacking that made a big diff for people
He says on the public stream because it's not actually that secret.
koutsie irc person!
Hey, Beck.
40:47koutsie hello
Epic_Ninja_Elephant stumbles in. "What year is it!?"
All right.
Hello from IRC.
Did something happen in IRC that suddenly five people are showing up in the same two minutes?
41:15veqqio Just coincidence I think
koutsie not really, you're just in the twitch front page lmao
koutsie at least for recommendations
berkandev wow
I'm in the Twitch front page.
FullStacking you got twitch street cred
I think those are personalized recommendations.
Twitch does not think I'm important.
And if I was actually on an important people, I mean, it's telling me I have 19 viewers.
graefchen Secret is also an interesting word. Reminds me of I think about a very intersting corridor building over an italian city that is "secret". limesGiggle
I would have, you know, 19,000 if I was actually somewhere important on Twitch and doing something more than streaming Vim.
chamlis_ I just checked, nothing new on that front
I keep joking that one of these days I'm going to,
Do a hot tub stream.
But Raz the cat just doesn't want to put on the bikini.
koutsie sleepy baba as pfp tho, godspeed for that
Yeah, you little nudist.
All right.
So.
Hello, sir.
I'm in the wrong directory.
I started from the wrong.
easeout Yeah they prearrange front page time windows with streamers.
Let me just create a new terminal here.
FullStacking how to have a bad time, Cat + Hotub
berkandev `j lo` is kinda funny
So if I'm in the wrong directory, every terminal is going to be in the wrong directory, and that's going to annoy the hell out of me.
So let's close this other one.
Sir, don't eat cough drops.
Anything that's small on my desk, he thinks might be a cat treat.
Epic_Ninja_Elephant @FullStacking CatHub?
So he eats like almonds off of my desk.
And now he's like, oh.
FullStacking you would be rich
bok0non cat lean
Oh, cough drop.
That could be for me.
I eat cough drops.
Yes, sir.
Thank you Burke and Dev, you are the first person to notice that I have been streaming for a year.
And yes, that's, that's why I typed that I could probably just type JL but JLo is funnier.
Alright, so no, I'm not on main though.
Let's grab everybody down.
Great.
FullStacking gitea!
FullStacking I'm loving my gitea
let's get the server started you know i've been wanting a jujitsu hub to replace github and we could call it cat hub instead all right so i've got a local host did i get an admin out of the box
I don't remember what the fake data creates.
Let's just override.
44:06koutsie git is everywhere so call it whatever :D
ghost_user_1984 you know, given how works been I may do a βjutjusiu hubβ.
Got a test.
...20ghost_user_1984 But also on a random sidebar, has anyone found jj to suck with screen readers?
Good.
...30FullStacking Whats the big diff between jj vs gitea?
Oh, I have no idea.
I've never used a screen reader with it.
I've only played around a little with screen reading a browser for accessibility.
Full stacking.
FullStacking git tea
Is Gidia a client?
ghost_user_1984 web ui for collaboration vs command line tool
yeah so giddy is a forge for hosting jj is a local it's an alternative version control system it interoperates with git nicely but yeah all right so
So we have this screen for mods.
45:32FullStacking ah so kind of like its own flavor of git?
Yeah.
So this is part of why I loaded up fake data, because I wanted to show this stream screen, which shows recent notes and
moderation events.
So this is one of the moderator UI surfaces.
Albynton @FullStacking both are currently interfaces for git
bok0non svn LUL
Yeah, so it's in the same neighborhood as like Mercurial or Perforce or I don't even remember the name of Microsoft's.
46:09Yeah.
FullStacking god svn π’
So this page needs some fragment caching and I prepared for it.
ghost_user_1984 Visual source safe was MS
ghost_user_1984 i miss plastic scm
So unlike on comments or on user comments, we have these timestamps in here and the moderator has JavaScript that should update those.
So we will check on that and then view mod
FullStacking you like corrupted binaries in your repos? try svn
Notes.
bok0non @FullStacking @FullStacking when i studied cs like 10 years ago we actually had to learn svn instead of git at university
Tape.
bok0non still dont understand that decision
No, it's a view mod index.
47:05ghost_user_1984 honestly though SVN was great
It's this whole thing called not so.
Activities.
Ah yeah, Visual Source Safe is the one I was trying to remember the name of, thank you.
FullStacking I started in 2000 using flash in svn we used to loose whole projects because of it
I did use Subversion.
I wasn't an early adopter to that one, but the inability to run multiple branches was like, Git was such an upgrade.
ghost_user_1984 like most things, it had issues with bad design long term
And now on the exact same topic, Jujutsu feels like such an upgrade over Git.
ghost_user_1984 but it was such a step up
That's really painful.
I wonder if that was like a character encoding or something.
48:02Yeah.
Oh, man.
easeout svn over cvs was huge
CVS, which was built on RCS.
CVS was rough.
It was one of those abstractions that was just constantly leaking the details and that commits couldn't be...
Epic_Ninja_Elephant I liked svn quite a bit.
ghost_user_1984 I still have to use RCS at work
in in cvs really each commit was one file and the tools would just be like oh well if you have the same message on multiple files maybe that's one commit but it was such a kludge and again that's not a an insult to cvs because cvs was a giant step up over rcs you have to use rcs at work that's i feel like osha would have something to say about that that's
bok0non does it come with free ptsd councellig?
ghost_user_1984 no we checked
you know if not osha the hague why why would they make you use rcs
49:18ghost_user_1984 because I am stewarding the continuation of As/400
so what i want to do is wrap caching around these individual items i think but i'm gonna have to get the the guide up because we haven't done this kind of russian doll caching before so
...57Epic_Ninja_Elephant I'm so sorry @ghost_user_1984
WhiskyFueled42 AS400, oh no
Okay, so we'll say,
We're going to cache ma.
ghost_user_1984 honestly like mainframes support sftp these days
Do I want to cache the mod activity?
No, I want to cache the item, don't I?
50:29ghost_user_1984 and nfs
FullStacking if I recall and its been since 2015 since I did of of this you have to be mindful of any dynamic calls in these else they void that partial and that can trickle up
ghost_user_1984 But this thing? No
And I want to say there's an option so I can tell it to look at the updated app.
...41FullStacking IE smart trunks, vs stupid leafs
I'm not sure what you mean by dynamic calls full stacking.
...49Stewarding the continuation of AS400. Wow. Classic.
...59Based on the view fragment, cache version is directed for the product. Yeah, see, this one doesn't say that solid cache will. So we're going to have to look into deleting old things with solid cache.
51:32FullStacking calling functions in a nested partial which is an anti pattern
dlamz is the performance for that page bad?
we're not actually we don't have a partial all right i wonder if i should create a new cache for this because we actually like it's really cheap to create new databases with sqlite and you know it's just one extra file handle which is cheap until your process has 100 000 open so
But the thing about it is it's going to have a really different access pattern where all of these things from fragment caches are going to be, call it 200 to 2000 bytes.
52:31I already split the cache and the queue out.
...47FullStacking ask long as you compose all you needed data at the root most layer and pass in the data as props vs doing anything dynamic in the nested layers you are typically good
These are some defaults.
Yeah.
DLAMs, yes.
For moderators in production, that page takes nine to 11 seconds to load, which is pretty bad.
And it might have an n plus one on it.
Yeah, it does.
That was way too many queries.
And because there's a polymorphic association, we can't preload across it.
FullStacking was gonna say you all use newrelic or other telemetry
This is just one of those cases where we want something that Active Record, that SQL can do very directly and very easily.
I could write this union query just off the top of my head, but Active Record does not support it well enough, unfortunately.
54:18pushcx https://telebugs.com/
dlamz sentry throws alerts for n+1 queries for django, unsure about rails
We do not have New Relic or other telemetry, but we do have Telebugs.
FullStacking I"m in portland and seen Sandy metz there, was a great talk
Oh, I don't think I put that in the About page.
I guess that's an expense for the site, but it was a one-time expense.
So I don't really think about it.
bok0non free profit!
Oh, it's gone up in price since I bought it.
...45yeah and the way active record is so so painfully foot gunny about wanting to create one plus n errors that honestly it's a a better idea to move to sqlite where one plus n errors don't matter
55:09FullStacking If I recall bullet was a good tool for that
FullStacking no this was back in 2018
Are you talking about the XORuby conference that was just in Portland a couple of days ago?
Or are you saying you saw Sandy Metz a few years ago?
Because I didn't think Sandy Metz was still active in Ruby.
Yeah, back in 2018.
Okay.
FullStacking they did user groups there at new relic
Yeah, we do... We used to use Bullet.
And...
It has a significant performance overhead.
And so eventually it got cut because I worked enough of the one plus N errors out of the user facing side.
...57So that looked good.
I reloaded.
FullStacking ruby brigade was held there
We still get a page.
We don't get an error.
Four seconds.
Yeah, it's still taking four seconds.
Why is this so slow?
Let's come here.
Reload.
Show me the queries.
Yeah, so it's got to render those things.
And there are still doing, oh, caching is off because I'm in development mode.
Can't test caching with that on.
56:41FullStacking Fun fact I used to run the Ruby user group back in 2012 in Saint Louis at The Able few
There we go.
All right, so now if I reload, this one should fill the cache.
And it takes 6,700 milliseconds.
So that's probably filling the cache.
And now if I load, still 6,600.
Now we're back down to 4,000.
This is rough.
You're still doing 392 queries.
So it's got to select the moderations.
Oh, there we go.
But now it's one plus ending the solid cache entries, and it's serving these out of the cache.
I understand why it's got to do these one by one, but that's a little rough.
57:39I guess I could also put a cache around the whole table if I knew the cache key of the, and I make the cache key the ID or the timestamp of the latest item in the table. Let's try that.
58:19Yeah, hold on. Where's my to-do list? So cache activity, table elements, cache entire table, confirming JS timestamps.
...38So that's done.
...54Sorry, this is every ERB template. It just ends with a series of percent and tags.
59:04FullStacking Holly cow we wave a winter advisory its so cold today
Papercraft is interesting for being kind of a DSL on top of generating Ruby.
FullStacking man my typos
And Marco Roth, who's been doing a ton of ERB stuff in Rails, dropped by the last stream and said that
pushcx https://www.xoruby.com/events/
lot of the guarantees i want out of a builder style library are going to be available from herb so that could be promising full stacking you should check out xoruby.com events so jim resnick who and the flagrant crew flagrant flagrant i never know what that company
folks who run madison ruby are running a series of events across the country i want to say there's two left and they are trying to johnny apple seed the regional ruby conference ecosystem back to life
01:00:11FullStacking Oh see they got portland listed
Yeah, Portland was just last Saturday, so two days ago.
So you just missed it if you're in Portland.
But you could drive down to San Diego with Jim.
You could chase him.
You could take the high-speed rail down.
...33FullStacking OH snap, we have been "distracted" the last few days.
I guess what I want to do here is give it the ID of the latest...
Right?
It doesn't really.
So we'll say ma.first.
01:01:00OK, sir.
...07Yeah, Chicago hasn't been too quiet either.
...17FullStacking Lots of events going on lately frogs and naked bike rides in the rain was most of this weekend
So I can just give it the item.
And presumably, if it's nil for somebody with an empty database, that'll get busted when they have anything to put in the table.
That's probably OK.
Oh, it's out here.
It's modActivity.first.
01:02:02Well, that did drop the size at the time quite a bit, actually.
FullStacking Nice
Yeah, now we're down to doing three SQLs.
You can see the cache working.
because it still had to retrieve the items.
But then to render, it just said, let's look in the cache.
We've got the cache.
We're done.
That's great.
...37Let's go peek in the cache, because I haven't used this before.
...48Storage. Cache? No. db cache.
01:03:01db development cache.
Nice key light.
FullStacking wait sqlite cache? all of this was sqlite
3db development cache.
Yeah, full stacking.
That's headed a little off topic for this stream.
so so the database is maria db but the cache is all sqlite no it's not desk it's
...49Trees ordered by ID desk limit one. Let's just look at that last one. And it's in the table, which is what we expected. And then that must be the hash for there. Great. So if we do that and we say, now let's look at the value. This should be our big block of HTML, right? It's compressed. It must be gzipped or something when they stick it in the table. That's fine. So let's select key from solid cache entries.
01:04:37Okay.
graefchen sqlite has become yuite good as far as i know. But I am also farily new to it and I have already seen it as fairly good. limesD
I must have put something else in this cache and deleted it.
yeah so there's the highest integer was like 803 and now there's 782 records in the database which says something else is in there 20 somethings i'm not too worried about it all right so let's let's see this work so if i reload comes right out of the cache and it's pretty instant that's fine and if i add text that should invalidate
FullStacking the crazy thing Ive been seeing is postgres in wasm
invalidate the cache.
And anytime I'm doing debug messages, I always like to put the like a 123 at the end of it, because I always end up editing them.
Yeah, there we go.
So now it had to think about that one.
And it could use the inner items.
So we'll probably see.
Oh, no, that's interesting.
It actually busted the entire cache.
So I guess that Russian doll caching, rather than trying to just be a check on whether the...
So it's got the view template key in there, and I had just sort of assumed it was going to be the portion of the template that's inside the cache tag, but it's clearly any part of it.
All right.
FullStacking you have to be mindful how it bubbles up
That's fine.
I just didn't know it.
And then that'll clear the cache again.
And most of the load time is these avatars because we're in a single threaded mode, so everything gets blocked up and there's going to be a hundred different avatars on the page.
01:06:53Great. I think that's, no, there was, I was going to check the, I was going to check the timestamps. So this timestamp is a time object with a title and a date time attribute, and then application JS.
01:07:27Oh no, I thought I wrote this JavaScript. Did I start doing this on a branch and I lost track of my branch?
...48Yes, I did start doing this on a branch. All right, let's take a look at what I just re-implemented.
01:08:01and 814 speaking of how code kind of hangs out see i just want to get that code back and merge it into here yeah so not most of this oh it does care it does care if you are the user being rendered that does need to be part of the cache key because you see a different byline on these things
01:09:06All right, so what's different here is just those two caches and the config cache. Can I join that in? No.
...31S-R-R-L-X onto the current one. Good, and I get that conflict because I was just getting a little bit of demo of jujitsu here. And so if I jump up to RLX, which is now on top. Yes.
01:10:12What's the... I really do want to just merge this down into the previous commit. Is it absorb?
...41I'm going to revision into the stack of mutable. Squash is what I want.
01:11:22And then I've got these conflicts.
...39And honestly, the other side of that was better. So this is the one I don't want. This one I do want.
01:12:28Not that and not that. So now if I reload, now
01:13:01You still think I have a conflict.
...31And this is the line I want to keep. So we have this cached for each mod, which is not great, but I guess that's acceptable.
01:14:00And then. When we go find the time tags, you know, thinking about it, I don't actually need a separate
...46I don't need a separate tag. I can just repeat these and then. It'll have. Yeah. Where are you? Application helper.
01:15:23Because there's really no harm in having. So if we said time, and then we said ago, and this is how long ago label worked, then it would fill both roles.
...57It wouldn't need to be a separate call. And the JavaScript will still run and replace them.
01:16:16We just want to have a time that has a Data had eunuchs attribute.
...39Select her. Search for time we'd find a bunch and if we searched for.
...53At Unix, we wouldn't have any because I loaded this before the branch. So let's reload. Cool. What are we mad about? Probably an unmatched end.
01:17:32Did you duplicate every damn thing? Yeah, you did. Okay. Okay, that conflict resolution actually just made things awful and complicated. So all of this in the middle is dead code? Down to what? Oh, this is ugly. So we have a mod note.
01:19:33It's removing 170 to 90, which is duplicated.
01:20:04And then do I get a reasonable diff out of that? There's the cache. There's the end. There's the new end. That's all correct. OK. But the page even loads now, right? Right? Right? Please? There we go. OK. So if that wants to load.
...28And then, yes, that selects all the timestamps. if i reload we only had three sequels excellent so now we've got fragment the russian dial caching around the element and around the table and then for each individual element So it'll originally get rendered with the text, the relative timestamp, like 30 minutes ago. And then for moderators, the JavaScript will replace it. Well, for users too, but users can't see this. So that's great. Let's just check our diff.
01:21:25Good. Don't need that class anymore.
...43And then there's the duplicate. This was just like I copied and pasted it and then just tweaked the syntax. until ruby became javascript they're close enough together it was just straightforward
01:22:23Cool, that's it.
Bookmark, delete.
Don't need that anymore.
And then this becomes main.
Cool, let's deploy.
So yeah, we're about an hour 20 into the Lobster's office hour stream.
You can, can I just up enter?
pushcx This is Lobsters office hours, drop in a question about the site anytime!
Nope.
That was the big feature I wanted to get done because that activity page took a while.
01:23:24pulling it up off screen just to peek at it and you know that first load that usually takes 10 seconds is going to take what 12 because it's writing to the cache but then it should be basically instant and i'm not going to pull that one up because that's got live notes from people yeah Yep, that's basically instant now. Cool.
01:24:02And by basically instant, I mean it loads in production in... What is this? 105 milliseconds? That's about as good as you get in Rails.
...45graefchen Fast Websites are nice limesComfy
yeah and i especially like to experiment with new rails features like fragment caching in moderator interfaces because if we see the site be a little bit janky or broken it's a lot easier to handle because there's only a couple of users rather than you know the whole world sees it or the site crashes visibly
01:25:25This one, the most annoying part of this is because JavaScript has a bunch of statements instead of expressions. I couldn't just return the string and say inner text equals, which is what I would like to say. When I write my own programming language, everything will be an expression.
01:26:04chamlis_ do one big nested ternary with appropriate indentation
so catch the table yep that's all those things all right so gave it a minute but nobody's asking questions so the other thing i wanted to do one big nested ternary you know if i never wanted to edit it maybe i would
...30I'll just go back to CoffeeScript, right? Wasn't that nice?
...42So, Chamlus, since you just said something, this next item on my list was actually prompted by your work updating CommonMark.
Hmm.
So for anybody else,
chamlis_ coffeescript was around when I started learning programming, but I didn't know enough then to really understand what it added
Channelist just did a PR that updated our common marker and our markdown renderer actually changed underlying libraries and rendered stuff differently.
graefchen Testing is always better than not testing. Reminds me of a cool Story about League of Legends and how when they bring out a new Champion, it has in some Minutes way more Playtime than them testing for a few Months. limesLurk
Yeah, CoffeeScript, I mean, if you look at ES6, it gets you 90 plus percent of what was in CoffeeScript, so I wouldn't worry about it too much.
One of the hassles I had with updating common marker and making sure that all of the sites 610,000 comments rendered the same is that when we render terminal
01:28:04We render a comment once as we're inserting it.
...16Gretchen, that's pretty funny, yes.
At the time the comment is posted, we render it to Markdown and that is saved indefinitely to the database.
FullStacking Hot take: get up to snuff with web components as most of the js will be that in the near ish future.
And if that goes very well,
I may replace that with fragment caching if the stuff on the mod activity goes well.
...49You know, full stacking, it's funny.
FullStacking thats nice!
Lobsters does not even serve JavaScript to a user who's logged out.
So if you pull up...
Here we can...
FullStacking I like everything you just said
bring up a private tab in my browser so if we go to localhost and we're logged out and we go look at where is it debugger yeah mini profiler has a little javascript but the site doesn't application no service workers no manifest
01:29:40So if I went to lobsters and I brought that up, this page has no sources.
...51So that's part of why we're fast.
01:30:00FullStacking one of my bake issues with rails and even elixir/phoenix has been the massive overuse of js as of lately. Turbolinks / Liveview
FullStacking big*
especially on older hardware.
And then even if you are logged in, we serve our JavaScript file.
And what was that when I flipped by it?
Yeah, it is 882 lines, including blank lines.
know it's funny something like turbo links or hotwire is actually kind of tempting because for what we do if you are browsing around the site clicking on comments clicking into and out of stories doing partial refreshes of the middle of the page would be faster we're not serving you like big interactive things but
FullStacking I was in this camp for the last few years but I had a change of heart over the last year
The ability to preload those would be fairly nice.
Like Turbolinks, I think out of the box says if a link is a get and you hover over it, go ahead and start preloading because that'll give you a...
depending on how fast somebody is with the mouse, that can give you a 50 to 200 millisecond head start on loading that next page, which for us would be all of the time you need to load that next page.
So it would be kind of neat if those pages were instant.
But the downside is that initial page load then has all that extra stuff in it.
And Turbolinks is not especially small.
01:32:00FullStacking I personally found I think it over complicates any other js. so if you are going vanilla turbo then its fine but if you need any other 3rd party js thats where it all goes off the rails
What changed your heart on this one, full stacking?
...13chamlis_ I imagine we could find or write our own version that did just that in not much code (famous last words)
So it's like your global variable from page A is now carried over to page B because you didn't really do a full page load?
FullStacking its all about who owns the dom
Yeah.
Yeah, Chambliss, I think that would be something like HTMX or Datastar.
I want to say Datastar is like three kilobytes of JavaScript.
...44FullStacking the dom become the fighting ground
But it's not something I seriously want.
It's just like, oh, it would be interesting if we could have all of these pages just that little bit faster.
But then we have stuff like
FullStacking in the case of elixir and liveview it also requires a websocket
chamlis_ I've used HTMX at work to quickly get dynamic admin panels up and running, it does that job admirably
in the header you have your karma and if you never load another page you never get a new number there yeah i don't want to chase those things down it's always that like one or two last threads that have you breaking the whole paradigm and especially because we're so limited on developer resources i want to just do the very simple things
01:33:30That's a pretty promising endorsement actually.
01:34:16FullStacking so what I found is that I think will be the future in this is Declarative Shadow DOM https://web.dev/articles/declar… The big issue with most stacks at the moment that try to add a front end to something non nodejs is SSR https://web.dev/articles/declar… addresses that.
want to have a created app don't want to say like renamed away so the gist of this is that when we let users change their usernames
...51Declarative Shadow DOM. That sounds like a Tom Clancy novel. Big issue is most stacks as you try and add a front end to something non-Node.js is server-side rendering. All right, folks, light mode warning. Declarative Shadow DOM.
01:35:45FullStacking think web components that the server can render
FullStacking pre hydration components
Okay, so they are going for all of the good things and none of the bad things.
Good luck.
Yeah, I mean, and I guess that code I just wrote a minute ago with the time labels,
is the hydration problem.
01:36:22It just doesn't look like much when it's literally one line of HTML and it doesn't have to be a separate fill.
We do it once at page load instead of all the time.
Why is this?
FullStacking but this is what I think hotwire and like frameworks ends up botches
oh this is the link that it generates that's fine so the hassle here with rendering comments once at creation is that it at the creation time it's checking if the username exists when we re-render comments the users may have renamed and so what was a link is now broken and we have also seen the inverse where someone said
at like and it can actually be like an at at include and then someone creates a username named include and now when we rerender the comment it links to that user who did not exist when the comment was created which looks very strange when you see a comment that's 10 years old and you click on the username and the user is one year old it's like are you a time traveler so
we really need to re-render these comments based on the usernames as they existed at the time.
And realistically, what that means is we have to backfill a table of all the usernames that have been in use on the site and then track them from now on.
So that when we render a comment, we include the timestamp of the comment
chamlis_ can A rename to B, then Z rename to A?
and use the usernames that existed at the time the user gave that username.
01:38:32Yes, chamless. So currently, that is the way it works, which is also distracting and confusing for this use case. I think I would like that to no longer be possible. And I don't know if it has ever happened. So we will figure that out along the way here.
01:39:29chamlis_ if you forbid that you can get away with a list of past aliases for each user
FullStacking that sounds like it will bust any cache
chamlis_ right, yeah
yeah so gemless the thing is i don't know if it's happened in the past i did see one user where like adam renamed to bob and then two years later bob renamed back to adam i was just looking at that in the last day or so
01:40:01See, what I really want is to share this. Do I want to copy these up to a module, maybe?
...34Yeah I guess I have to.
01:41:17chamlis_ I guess in strict normalisation style you'd drop username from user altogether and the current username is the most recent?
FullStacking side question: Have you looked at cloudflare for caching they have a some what generous free tier.
No, we've never looked at... Yeah, if we were going to do...
FullStacking makes it simple dealing with that at dns layer
So channels, if we were going to do like a third normal form, I would drop the username column off of user.
I would rather not do that.
And in fact, I would actually rather go the other direction and copy username and avatar to comment just to minimize the number of joins we do on the hot path if I was really going to refactor.
as for cloudflare for caching no we've never looked at any kind of external caching and would like to not because i don't know just feels like you should be able to throw up a website on a vps and run it especially for text which is so small
01:42:17So all of this wants to come here. And this comes here.
...40These should come here.
...48FullStacking I only only saying that because I use their free tier and its nice but to each their own and honestly I'm not so sure I want cloudflare to know everything about my traffic.
This is that method that was referenced over there.
And then this would be handy in this model as well, except username won't be unique here, probably.
Yeah, so I can't have that.
01:43:34Is this username regexs? Is this dead code?
...44No. But it definitely can move over.
01:44:44Thank you.
01:45:25That's all the instances username in that model. That looks correct.
01:46:05So then if this is up, down is going to be drop, table, usernames. And then we're writing the migration. So that's going to be, what I would really like is just an insert all. Do we have one of those in? Rails.
...40Yes.
01:47:07So you want to say username dot insert all. And then it takes a hash, an array of hashes. Yes, an array of hashes. So that's going to be, how do I get hashes?
...41I say, fuck, I'm just going to get an array.
...51Active record concern. It's not active record. Is it active model? Active support.
01:48:14Yeah.
...48All right, that's good enough. It's migration, it's only gonna run once, right? Except we don't wanna say pluck, because we want the created at.
01:49:53Let's see, we don't need a unique.
01:50:06And then we can say returning. We don't need a returning. Yeah, we don't need an updated at because these are kind of a log. This shouldn't be null. This shouldn't be null.
...43Need the ID.
...51That'll be it.id.
01:51:09Let's watch that migration crash, because I have a typo. That migration ran? Sure didn't expect that.
...24Looks like it actually worked.
...32Yeah. Great. Now we just need some of these users to rename themselves, huh? Let's go look at that controller. So this is where all current usernames in use. And then we have to backfill old usernames. And then let's go up to the settings controller.
01:52:25Actually, before I do this, so to do, close old username record, create new one, close timestamp.
...54See, oh, this is up in the controller where it shouldn't be. This is not the commit where I'm gonna be introducing a service layer though.
01:53:22Why does this say is from suggestions? If you change your own username, it says it's from suggestions. That doesn't make sense.
...38Let's go look at production.
01:54:18veqqio Upvoting is broken
veqqio It causes apage reload now
i guess so of the 1200 usernames that have renamed in production
...45yeah vic i just saw your message in irc let's let's put this on ice and
01:55:18Create a new one here.
Yeah.
And let's go find out what's wrong in prod.
So I have my personal browser up where I'm actually logged in.
veqqio Sorry for coming in like a bull in a china store and interrupting previous stuff
And what I'm expecting is I'm going to upvote story and get a JavaScript error.
...43which I actually got the moment the page loaded because of unidentified somebody identifier. Let's go look at the JavaScript. So I did just push a commit with JavaScript. And I think upvoting is one of the last couple of things that requires, you know, if I broke core site functionality, I would really prefer that you come in and interrupt.
01:56:18So over in my personal browser, I got syntax error, unexpected token identifier, but then it didn't link to my actual line of code. It's saying line or five 47, which is this just one of those where the error is actually here.
...55Can I see this locally?
Yes.
Okay, so this will be easy to fix because I can see it locally.
graefchen I think fixing bad commits is way more important than doing other stuff limesNoted
So is it something about... Oh, it's the...
I bet I needed to say const in front of all of these.
01:57:27And then I didn't catch this error because I changed the text of the time ago to have the default text, so I didn't catch that it was failing. So unexpected token identifier, still on 547. Number 33. Typo.
01:58:14This is an incomplete transformation from the Ruby. That's what this is.
...54Well, JamList, you wanted ternaries.
01:59:19JavaScript doesn't have a better way to interpolate this S now, does it?
...34I don't think so. I think I just have to deal with the.
...46graefchen That is JS, right? Because the "#" confuses me.
So in becomes hours, hour, hours ago.
Because days.
days yeah the hash is i mentioned i copied it out of the ruby implementation and i transformed it into js and i guess i did that in completely oh you know yeah that interpolation isn't going to work at all yeah
so let me fix this first thing and then i will do that second thing yeah so that'll be months months months years year years and then instead of a hash here it'll be
means plus.
Right.
Oh, that's going to be an integer.
Is that going to do what I want for plus power?
OK, yes.
02:01:26And here we'll say days plus day, months plus month.
...50OK, no JavaScript error. Do you work, though? I didn't make this a function, so I can't just check it. But I notice all of these timestamps disappeared. I see the word ago.
02:02:50gtfrvz there is also Intl.DurationFormat
I don't know what that is.
And I'm trying to keep our timestamps consistent.
02:03:23porridge3463 Is being unable to upvote anything right now a bug?
Why are you just the word ago?
...42Is it a precedence thing here?
...56chamlis_ I think the precedence is funny on those ternaries
Undefined hour ago.
OK, so it's a precedence thing and a. Yeah.
So we get that that.
02:04:33veqqio @porridge3463 currently working on it
Hey, Porridge, yes, that is a bug.
I deployed code and broke it a few minutes ago.
We are hacking up the fix right now.
...52Why would ours be undefined if it's right here?
02:05:14chamlis_ I think floor is different in JS
Does JavaScript not like me dividing by a float?
...25No, it's floor. It's floor. Yeah, we got it at the same time there. Is it math.floor? Yeah, all right.
...41chamlis_ Math.floor(...) instead of .floor
I'm so used to reading
Ruby syntax that it just doesn't read as wrong to me.
Yep.
Okay.
Better.
We're missing some spaces.
02:06:38chamlis_ a couple of minor typos: missing space before "hour", extra "#" before day
chamlis_ darn my slow typing...
Looks like I caught those as you were typing.
Hash before day, yeah, I got that.
All right, I think that's everybody.
I'll delete the console log.
02:07:46So we should have that fixed in just a second.
02:08:49suppose i should actually go look at prod in my personal browser yes i can load things just fine
02:09:30veqqio well done!
Okay.
porridge3463 Rewrite it in Elm!
I mean, you say well done, but if I was more thorough or we had any JavaScript tests whatsoever, we would never have shipped that to prod because shipping literally invalid JavaScript is a lot of things could have caught that.
...53veqqio Remember, I think it's endearing and humanizing that prod breaks sometimes!
porridge3463 Rewrite it in jsofocaml!
All right.
Be right in Elm.
I was just chatting about Elm with a coder I know who
veqqio rewrite in gleam!
porridge3463 js_of_ocaml
mention that they had seen a talk about island and i was like really i thought that was kind of had petered out or maybe the creator went into a cave for a while js of oh camel what the heck is that
02:10:33graefchen Where would be the fun if it does not break in prod? limesGiggle
porridge3463 LOL
hulkdx Whats jj? its new git?
Are you allowed to have OCaml repositories that aren't under the Jane Street GitHub organization?
...55That's kind of wild.
02:11:18veqqio @hulkdx https://lobste.rs/s/s4fffm/juju…
Yeah, the link that Vec just gave you there is a pretty good answer to your question, but it's an alternative version control system that interoperates with Git.
So I've been using it for a few months, and if you look at my comments on the site, so if you search commenter pushcx for the word jujutsu, you'll find a bunch of my comments of what I think about it.
But basically, it's completely replacing my use of Git because...
graefchen The Creator of Elm has an ... interesting way of developing his language. limesNodders
it's just more comfortable it has a much nicer user interface it has a couple of features like shoving these commits around where i don't have to deal with conflicts so badly yeah yeah he the creator of elm works play-doh style where he goes into his cave for a while and then eventually comes out with interesting ideas
That's why I say I thought it had petered out, but it's possible he's just working on something for a while and he'll come back in six days or six months and be like, okay, new version, new feature.
02:12:45porridge3463 Do you think Git's failure to prioritise end-user experience for a long while up until fairly recently is why jj is catching on? like why is there no git undo?
All right.
What I want to do is backfill some fake moderation entries in development here.
I don't know why that says is from suggestion.
i think that is a big part of why jujutsu is catching on yes is gets ui is is very clunky and it constantly exposes much to low-level primitives and just the messages in it are not
Epic_Ninja_Elephant Some better default aliases in git would help a lot.
informative they're kind of written in that man page style where the the complaint about man pages is they make sense once you already understand what they're saying but you can't actually learn from them it's not that they're wrong it's that they're not useful
02:14:36porridge3463 I'm stealing that
NoGoodNick_ not even wrong
porridge3463 it's not that they're wrong, they're... not useful
I mean, I understand what's happening in Git when it says that I'm in a detached head state, but that's not a useful set of error messages.
That's not a useful state to be in.
Actually, no, I take that back.
It is a useful state to be in, which is why it's so frustrating that it has an obnoxious, unclear name.
02:15:14I'm just going to fake this. So say u.id.
...59One year ago. Is from suggestions plural.
02:16:12Validation failed item type is not included in the list. Why did that try and create a mod activity?
...36This was part of that.
...47But what was the actual type?
02:17:04Yeah, that didn't get inserted.
...41user expected got user, which is an instance of user. What? What are you even mad about?
02:18:06Aside from this should be
...36So yeah, that is a user. We create a user for them. This is from suggestions is probably just to satisfy the constraint on moderation that has to be from suggestions or have a moderator attached.
02:19:20Why can I not even make an object? What if I make a hash? I can make a hash.
...47I can make that. Okay, just something weird about the association. It didn't want me passing a model. to get an id i don't want to think about what was wrong with that so let's find another user and do that again say 11 months ago and then let's find somebody else we're going to insert two of these so we'll have one 10 months ago that they changed from old uid to u id and then Nine months ago, they changed from UID to username.
02:21:07Okay, so now we've got a bunch of moderations in our test database that we can migrate.
...44And the hard part here is I just have to trust that no action has included the phrase changed own username.
...59Because it could have appeared in a comment or like the description of a story. And then I deleted that text and then it appears in one of these, right? Production has that kind of stuff. It would probably be okay, but this kind of thing is a little bit of a hassle.
02:22:38We do have to parse that out, don't we? So let's say
...51Let's do it here.
02:23:02So if I said s equals tilde, and anything that's not a quote, a quote to quote anything that's not a quote to the next quote. I should have gotten a map.
...59Oh, I needed a plus. There we go. And then what are the secret match data or the global variables? I never remember this API.
02:24:56There we go.
02:25:15This
...35I need to capture.
02:26:13So let's say old is. Match one you is match to.
...34And then we want to say username, insert. User.
...48I'm having a recursive error because we're not going to be, Oh no, the moderation object will be linked to them. Yeah. So I can say moderation. All right. So the user is the moderation user. Username is the old one.
02:27:18created at is going to be the last time they renamed. All right, so we got to think about that one. And then renamed away is going to be moderation created at. So this one is going to be the time that this user last changed usernames. which is going to say also we have to look at the moderation table or the user object.
02:28:12So how do I want to do that?
02:29:06Why is this use find each? All right, there's only going to be 1,000 to find. User where, and then action is going to say action like.
02:30:05This is gonna be a lot of quote. Let me just say that from two.
02:31:35OK, that's ugly, but possibly even correct.
...45So this needs to have a backslash to the database. Let's see how that goes.
02:32:01Undefined user. Because this should be moderation.user.
...24And now we're in an inconsistent state in the database.
02:33:17Wrong number of arguments.
...25Well, you don't like insert bang, huh?
...37So what does insert bang want? Single record. with attributes and then returning nil and timestamps. And what did I give you? I gave you attributes.
...57Returning nil core timestamps.
02:34:14you probably just want some parentheses yep unknown attribute user for username oh this is should have with the user.
02:35:36Let's have what you want to just give you a user ID. It's kind of weird. You should be able to use the association.
...53That's kind of promising. Let's go. Let's go look in the moderations in the usernames table.
02:36:07Okay, so yeah, U20 was in there for a while. And then U21 was in there for a while. And these dates are out of order because I was just messing around in the console and not thinking about. And then old 22, a while ago. U22, all right, so that time is wrong, right? I'm going to stand up real quick for a break. I'll be back in just a minute.
02:38:17Alrighty, I'm back. Let's turn that little note off. And what do we think happened here? So we got the correct date, but this date should have been the same as this date, which means it failed to find... Yeah.
02:39:09Let's just see it again. I wonder if I'm looping the moderations in the wrong order. Yeah, failed to find it. It's probably I have the wrong number of quotes or something.
02:40:27It's just doing the literal word new. Because this is in single quotes.
...57That's not what we want. We do actually need to interpolate that.
02:41:09So that becomes a quote. That gets a single escape. That gets a single escape. That becomes a quote. This also gets a quote. Yeah.
02:42:11So that ID I just shoved in there without talking about it is just so that we don't break when users are renamed multiple times.
...25And that's saying I typoed one of these escapes. That's awful.
...44That sure looks correct.
02:43:28Did I just paste from an old buffer? Because that doesn't match what I just selected. Yep, fun with clipboards.
...49So I have an extra quote in there. No. From percent two.
02:44:04You're mad about the ID. How is that possible?
...18Oh, I didn't have the question mark in there.
...37So now let's see if that's correct.
...44No.
02:45:00Why did you fail to find it again? because it's not the old one I wanted, it's the new one. There we go. See, now the idea is in there. And if I go look at the database. That timestamp is correct. So. using the fake history. These two timestamps shouldn't be before each other like this, but that's fine. That's the me filling in fake data. It's getting that continuity correct. So that's great. All right, so I'm throwing on the last call banner because this is done. I would like to run it against, I would like to restore prod data to my local But that's going to take a while. Typically, it takes 10 or 15 minutes. And I don't have something else I want to do. So unless somebody wants to ask a question that takes 10 minutes to answer, I'm going to finish this after the stream. Oh, actually, it's going to take two minutes to restore. That's fine. I can chill for two minutes. So let's.
02:46:56So settings controller.
02:47:11marcoroth_ Hey, I was wondering if CI on main is broken? Looks like it π
Oh no, I broke main.
That's totally possible.
I haven't really been testing as I've been hacking some stuff out today.
And I did break prod, so...
...59This thing, this is that validation that I pulled in from my merge. and I deleted because it was being strange. So I think I've already fixed it locally, but I will double check before I push this because I'm kind of in the home stretch on this.
02:49:50marcoroth_ no rush, was just curious
What is this, update all, right?
02:50:30Craig, I don't feel great.
...52So that should create the new username records when somebody renames themselves.
02:51:16I guess that database load is still going in the background if counting the number of users, which is a table with 120,000 records, is stalling like that.
02:52:10All right, so the database reload of prod stuff is kind of paused. So I'm going to jump over to main and take a look at the build. Actually, you know what?
...36Let's see if I did indeed fix this here.
...50Because if I can, I'll just split this out as its own commit and shove that up. My database restore stalled out. So I'm back to, I will test this migration off stream. Oh no, look at all those red Fs. F for fantastic, right?
02:53:31Okay, so this is, I can't even change settings.
...41So let's just go fix main and I'll rebase onto it later.
02:54:13That's a lot of failures. That's going to be everything that touches moderation, isn't it?
...23That probably means user can't rename in prod right now. Why did the test suite fail?
...40See how much of the suite that gets back.
...49All of it so far, that's promising.
...57Okay, so let's just push that up.
02:55:11Okay, so marker, if you're still here, I just pushed a fix to the build.
...50Does Ruby show the building progress? No. Production build is running.
02:56:12All right, so when this is done and goes green, I'm going to go ahead and end the stream because we're right at three hours. everything seems good oh those just finished now it's running the slow thing so great the build is back to green main is back to green great and i will finish off that backfill migration off stream yeah everything is good cool go on i want to see the little green dot
...57marcoroth_ okay, cool. Just rebased
so if anybody has any last questions now is the time to slip them in under the wire otherwise about as fast as i see the green dot i'm going to click the stop streaming button so thanks for dropping in on today's stream sorry i broke production and the build for two different issues but getting some nice little feature improvements
02:57:26Any time, build.
...36I wonder why it's not finishing.
02:58:08Epic_Ninja_Elephant Thanks for streaming!
graefchen Thanks for streaming!
it's called the slow spec for a reason i guess what did the last green one take for time three and a half minutes okay so it'll finish in a second that's not my bug there marco because if you failed in under three minutes right it's got to be different
...42don't know what you're tinkering with on your branch but i don't know why category could have failed all right master is back to green master main i renamed that months ago this image is out of date or it's pulling the last one from the branch instead of main huh that's funny I don't pay a lot of attention to that little badge.
02:59:27Could just be that I have it cached and I need to reload. Yeah, okay. So if I shift reload, now it's actually green. I just had it cached. And everything is caching. All right. Well, cool. Yeah, there's the end of this Lobster's Office Hours. I will be back on Thursday morning at 9 a.m. Chicago time. And if you got any questions saved up or if you got any pull requests saved up. And Marco, let me know if your PR that you're opening clearly is... urgent, and I will take a look at it before the next stream, but otherwise it'll hang out till Thursday morning. Alrighty folks, take care.