Test stream, fixing bugs

Streamed

An unannounced test stream to shake out bugs in my streaming setup.

scratch



    

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

Recording



34So I've got the local server running. And there was this bug that's been hanging around for a while about getting the last of the inline scripts out of the site, which is nice for content security policy. So where did I have just one more? I want to say there was like literally one last, no, not that. The site has literally one last inline JavaScript URL. So let's see if we can find it.

01:13yeah so there's our include and then ah here we go story form had one yeah let's close the wrong tab this one oh this is actually okay this is the bookmarklet and so we don't actually run javascript off of this So I think I'm okay just marking this as done. Yeah, that's actually fine. Cool. Then let's look at, somebody just said they were going to attack that one. Yeah, that was Indigo. If you are the viewer Indigo, you can say hi or let's see.

02:11Let's look at, there was another bug.

...33Oh, a bunch of these are pretty painful.

...46This one got done already. So I left another issue open. This is let's fight rails. Oh, I should have had more of a plan.

03:14Alright, Indigo, if you're watching, sorry, I'm going to attack this one. Because somebody... Oh, this is different from the one that you said you were going to look at. Okay.

...30Alright, let's take a look at... Story previews. So I have this, and let's think...

...51I'm logged in, so if I were to turn on. Not logged in. So if I turn on story previews, I should see story previews. Let's see what goes wrong. I do see story previews. It's fine. Cool. Let's look at the Git log to see where I fixed this.

04:39Did I seriously fix this seven months ago? No, that's a different... That's a story form. Great, great, great.

05:06Well, if you didn't just hear the sound of a jet engine from the Chicago Air and Water Show, I set the noise gate correctly on this mic. Have to check the recording there for that.

...36All right, so this looks like it's working. And we have a test for it.

...59No, we don't. Let's add one. This is over in leafless detail. We have a user show story previews.

06:36afoocado \o/
Any of these care about a user? No. All right, let's... Yeah, I didn't have any specific one. Describe.

07:04What's my...

...17Let's log in as user.

...32afoocado first time in decades I see somebody outside of Go space code without colorful syntax highlighting
Does this have settings? Nope.

...54Create a story. And it's got to have a story text with some text window. Yeah, it seems fun. Story previews. I'll have to see if I can make that just a one-liner with user.attributes. And then let's get slash and expect response body. Oh, yeah. So I have a very stripped down FIM color scheme. There is a little bit of like, you might see that this get indicator is yellow if the font is big enough. And if I have outright syntax errors, it'll pull in a little bit of red. But otherwise, I just don't find colors in the syntax highlighting to be very useful the really useful one is like oh i forgot a quote and the whole thing turns italic or not just that level of syntax error and nothing else is especially useful because in ruby especially we're we're really blurring the difference between like methods and attributes

09:46See if that wants to work. Cool. I broke that. All right.

10:00Oh, cool. Yeah. This is a request spec that doesn't include What's the name, my magic name for that?

...44It's gotta be a feature spec, right?

11:01yeah so let's just make a home spec stories and move this code down to our new test file and then

...35actually so this should still be green because i just pulled the test out of it and then i'll run the new one

12:05oh i almost stepped on an existing file name so i should probably just be in there story text expected got preview shown all right there's that whole refactoring all right so

...35Is the field called description? It's called description.

...48The model attribute is called description, but all of the UI calls it the story text, and then story text is a different thing entirely, just to be confusing.

13:10undefined method get right because it's different when it's a feature spec visit and you know given that this is literally right here let's say

...40let's just grab you one thing i don't love about our spec is this all these handy things are like pushing me to think a lot about the grammar of this so like between it and scenario i have to change the grammar of this text which just feels really weird and clunky not what i want to be thinking about during editing let's just change the shared test data that never is a problem that seems fine let's do that and delete the right one why is this not oh it's in cool i deleted the wrong one let's restore that yay forget

15:15I wanted to remove that.

...29afoocado seems like the left window is cut off at the bottom
All right, that's better. That's actually relevant. afoocado can't see what you type there when you're in the shell
So this wants to say, expect page to include story description. Seems like the left window is cut off the bottom the terminal. Oh, it is. Yeah, I see it on the preview. You are not seeing the bottom line or two. Cool. So that's why I'm doing a test stream. So I can tweak. Yeah, so I have a really clever thing happening. And of course, everything clever bites me in the ass. The I have an ultra wide monitor and I use the awesome window manager. And so I made a layout so that this section is visible. And then you can't see that off to the right, I have the Twitch controls and the chat and the stuff. So if I reload that, it'll jump back to the default layout, which will be fine because it'll just be this window or maybe also this one okay so let's go ahead and edit that what did i call it streaming now oh this has some notes in it that i don't want to show on stream so let me put it over here in another window sorry this is just gonna be me talking for a minute because that has some notes at the top that are not worth sharing. So I said it should be 1280 tall. Okay, I can bring it on screen now. So this is the awesome Lua config for the streaming layout. afoocado just make sure to not show us the porn playing to the side 8)
And we say the streaming area is 1280 pixels high, but I bet what I failed to account for is that I'm chopping off the title bar, although this is chopping off in the wrong direction.

17:46So let's see. Ah, and I guess now I see how AutoMod works because saying the word porn in your chat message was enough to get AutoMod to be like, hey, this sounds naughty. Although it doesn't know that we are joking about not being naughty. I have a checklist for before streaming and like one of the items is go through all the windows and make sure anything interesting is closed. Swears. So if the streaming area is 1280 pixels high, and we're placing something to fill that, and then let's go over here to the screen capture.

18:46Thanks, Leeloo. So there are actually two chats because there's the IRC chat here. And you can't even see that I'm responding to someone because the bottom two lines are getting cut off. Cool. photogabble such a pro :p
I look like such a professional. So how did this get cropped? Is it a filter? Height is afoocado yep
afoocado 16:9
10 aha titus 1080 verse 1280. so what is it supposed to be 1080 i guess that would make it 1080p right 1920 by 12 1080i so we can close that change that now let's see how bad this goes let's reload awesome and switch back to the right layout afoocado oh my ^^
Oh god, chaos.

19:57That went terribly. Let's bring the code back here. photogabble rawdogging code with zero highlighting :o
let's bring the browser back i don't even know what layout i'm in i am in the wrong layout that's it this is the right layout for streaming there we go all right so let's bring that over here that back over here i'm rearranging much that's off stream it is not zero highlighting notice that the constants are in italic And so that's the Ruby symbols and the strings. afoocado the ugly font for string literals and symbols is "highlighting", yeah ;p
photogabble haha
Clearly, the Vim color scheme is going to have to go in some kind of fax somewhere if people are going to mention it two times in two minutes. So let's shrink that a little.

20:53OK, so yeah, now you can see that. afoocado indeed, that's better <3
photogabble now you point it out, it sounds quite accssible to the colour blind
What was I even doing? afoocado was that enough to get an account on the site? :D
yeah great okay so that was the cause of the difference so avocado thank you for pointing out that the bottom line was cut off that is fixed now now you can see me typoing at the command line which is you know best in life so we have undefined local methods response oh right because this one is i'm converting it from being a request to a feature spec yes avocado if you caught a bug that works so you can Just send me your email address. My, because the way the invite system works is I, on the settings page, can hit invite to send one to your email address. So you have to, I don't know if the Twitch chat has DMs. That would probably be instantly abused. So just email me your email address and I will do it when I'm off stream. because I don't yet trust this whole layout for me to avoid flashing my email inbox on stream. Although I can think of a couple ways around it now, but let's not experiment live, because that's probably a bad idea. Which reminds me, did I even clear my clipboard before I started the stream? photogabble thats why when I stream I use a "clean" machine. I do not trust myself not to share something i'll regret
Who knows what could be in there as he pastes the root password to prod. so this guy wants to say expect the page to include the story description so is that the fix for this spec looks like it is oh avocado i see your your message on irc that works out so let me just close out One or two things here. What if I do... No, if I do that, that'll definitely flash on stream. What if I change away for a second? Oh, cool. Yeah, okay, it flashed for you. All right. I will just have to come back to that. afoocado will do, thanks! <3
Avocado, if I don't do that within a few minutes of ending stream, please just ping me again on IRC because that'll... highlight it photogam well what do you stream and i've thought about making like an entire new user but then i would go mad if i didn't have my vimrc and so i just made a couple of tweaks so that like bash uses a separate history so i wrote what did i call it bash stream yeah and so like it uses its own stream file so that i don't control r and pull up some kind of embarrassing command or the file name of something i've done before and we'll see how that goes all right

24:29It's hard to carry on a conversation or remember my coding train of thought. So this passes, right?

...45Why is this so freaking slow? Why is this one spec now a 10 second spec? afoocado yeah, interacting with twitch chat while coding pushes up the difficulty a bunch
What did I do to deserve this? besides use rails where every spec has to hit the database. afoocado same reason I quiet Slack and Mail while in the middle of something complicated
Well, if I control C, no, our spec swallows the darn trace back so that I don't actually get the trace back of which spec I was in.

25:24There's literally, what, three, four specs in this file? Yeah, like seven.

...41Sorry, I've got... Let's just... It's almost certainly going to be in the one I changed, right? So we'll go one, two... three, five, four. And let's see if it is indeed this guy. One, two, three, four, bang. Okay, so now we know what's hanging.

26:23Let's break it out.

...31photogabble I tend to stream game dev projects I am working on with a small audience of ~20-30 people. More as a "watch me work" kind of deal. I have wanted to get a VGA capture card, so I can show DOS game dev, building the projects on my desktop, transfering via serial and running on a 40 year old computer :D
it's gonna work I bet but oh and if you are not in the IRC channel which I can now safely bring in there are people pointing out that I can't like count because I don't want to hit the turn on all the metadata and stuff because then it shows the usernames of people who've messaged me and such all right yeah i thought about so when i tried streaming a couple of years ago early on in the pandemic i did a thing so that i could bring the chat window on screen but then this resolution of 19 what is it oh just waiting long enough did it so like that's an awful spec but that's still an improvement okay so i tried to bring the two together and i thought about doing it and i was like why don't you just stream with things in a janky state just to see if it wants to work at all And then you can think about doing something clever. Oh, photo gavel. So sorry to miss your message for a few minutes there because I'm getting yelled at more by the IRC than the Twitch. And so that makes me look the wrong direction. Hmm. so if you're running a vga if you are working on a game dev and you need a vga capture cards you can show dos game dev are you like literally running a dos desktop like it's 1994 again or are you transferring for your serial running yeah running on a 40 year old computer he is they are excuse me okay photogabble I thought doing so would give me a unique angle, and something interesting for others to watch.
so why does this why does this just pause the spec for what was that 30 seconds something awful it's not it's not dash n it's a dash e too many commands which is who decided on this user interface in 1960 nine oh yeah that kind of retro computing photo gavel is pretty great for anybody who can't see the twitch chat he's talking about some real classic retro computing

29:45Yeah, OK. So if that's going to take 30 seconds, I'm going to scream at this guy every time I run the specs. So I can't double the test suite side time. What's wrong here? Oh, it's include. It's using some, that's what happens when I convert from one to another. Yeah, so that single test took 48 seconds and the whole test suite typically takes like 30. I'll run it as soon as this goes green. Yeah, okay, so that's more normal. So if that's four seconds of setup, that one spec was taking 44 seconds, when it is supposed to be like the whole suite in less than 44 seconds. Even single threaded. Because I figured parallel, yeah, whole thing in 15 seconds. So that's reasonable. Okay. So if I'm at a reasonable speed and then let's break the spec because I haven't actually seen that it works. So if I don't set story previews, this should say false, that no, it doesn't have that text. And it says expected to have the description and it did not find, good, good. All right, let's go ahead and look at this div. That's great. All right.

31:371274 okay and even though i'm not logged into github if i push up this should update and close good yay look we fixed something all right now i'm considering yeah there's no point in deploying it's just a spec change i didn't i already deployed this thing yes yes i deployed that a few minutes ago okay so if that's done what else is hanging out open so this was just i have wanted to do office hours for lobsters for a while because like i say that i will run queries for people pushcx https://lobste.rs/about#queries
about page says it if i just can i paste a link in the chat oh i get my own chat rules thanks twitch thanks i don't need to be reminded we have this thing that says hey i am happy to run queries for people but running queries non-interactively is hideously painful because it's like email peter a sequel statement and then a day later he emails back you forgot a a quote close quote or you got that join just a little wrong and then everyone is sad and it basically doesn't work so i figured if i can make a regular like weekly stream where it's maybe every monday afternoon i say i will stream so feel free to like drop by then to run queries interactively with me or ask stuff that might work Or just honestly answer questions, because otherwise people tend to make up answers based on how other sites work. Like, no, there is not a mod tool for pushing stories up and down the homepage. Everyone assumes that I can fix the rankings, and that's literally not a feature. And if you think I am running a secret fork in prod, you have not paid attention to how code quality works on this site. I mean, even this commit log that's on the screen now is lots of like, let's unbreak that thing. Let's unbreak that other thing. Why is this still broken? This is not a, yeah, this is not like a high polish kind of process. photogabble Did the logo background colour to server load thing get fixed? lol
But as long as people are hanging out and I don't have anywhere to be, let's keep hacking on stuff. I'm not going to grab this font size one because I have no idea what size anything is and my browser is not my standard. Did the local background color to the server load thing get fixed? Yes, ages ago. Is that, did I not close that bug? Oh, did not close that bug. Jeez, do I ever remember to close bugs? Yeah, so I fixed this. photogabble thats how long ago I paid attention to the repository haha
two and a half years ago time now utc does not belong to a branch on this repo what yes it does oh this is probably me shooting myself in the foot with like so it has a different sha-1 So prod has this 263 and GitHub sees this as, what did it call it? EDEDF, okay. So I think that's fixed. And if I log it right now, photogabble oh cool I didn't know hovering gave the current value
yeah this is fairly dim so that is definitely not pinned to 100 right now oh wait if i just hover on it i get stats right yeah current traffic nine percent so our site traffic is pretty heavily influenced by the u.s work week you can just kind of watch it go up and down so on a monday we have like 260 000 visitors drop by and on a saturday or a sunday we have well under half that and the reason that's all the way down at nine percent instead of fifty is that this traffic intensity is determined by people actually interacting with the site of voting submitting comments submitting stories rather than http traffic So long story short, people slack at work a lot. So there is another. All right. So I can close this one. photogabble my work here is done :D
Oh, look, here's even someone telling me years ago. Yeah, you could have closed this one. All right. Let's just yoink this over here so I can deal with that later. afoocado I'm running a silly site automagically collecting images from various IRC channels and it also gets way more traffic during work hours. People really do love slacking off during work :)
and then oh i actually don't like the preview settings let's go ahead and turn that off all right and then there's pro so that one's good all right so let's go back to issues They bookmark that right i'm going to be in that a lot on stream. This top one was so this is one of the rare bugs that I didn't tag with good first issue because it's. This hideously complicated bit of our database Oh, but I did leave a comment on this that was like let's do a giant refactoring to fix that because that always fixes things.

38:20not show that all right so somebody already said that they are going to do this one and i don't want to step on the junior developers because i'm really trying to encourage people to tinker with stuff yeah avocado that's the us work hours yeah everybody is slacking Someone has already attacked a bunch of these. afoocado most of my traffic comes from Europe, same thing there though, just different hours
photogabble I keep lobsters open in a pinned tab.
Watching me struggle through CSS is just... You would have to be a masochist to watch this kind of stream, and I'm not starting an OnlyFans for masochists. Tags doesn't... I don't have Safari handy. You keep lobsters open in a pin tab. Even I don't do that, but that's mostly because I don't use pin tabs. I use... So this browser that's here on stream is a new Firefox profile and it's basically stock, but I use Tridactyl over on my Workday browser. And it has this weird bug that I haven't remembered to report where every once in a while it interacts really poorly with the automatic tab unloading. So I have Firefox set to unload tabs after like 10 or 20 minutes of inactivity in the tab. And then somehow this confuses Tridactyl. And so if I hit D to close a tab every once in a while, it just closes a random inactive tab instead of the tab I'm actually looking at, which is a really painful kind of data loss, to have the wrong thing closed but i don't know how i would explain this whole setup and give a reproducible test case and i can't even regularly reproduce it i might be totally wrong about it being related to inactive tabs yeah consistently highlight i can't this would be a good one for streaming later after i have replaced the darn contents of the database. So for local dev, I actually load a copy of the production database out of database backups because a bunch of these bugs are best seen with real prod data. And then also it's a really good way to exercise your backup system because nobody wants backups, they want restores. And so if I'm regularly testing restoring to my local dev, I know that works, and I have high confidence our backup system is working. I can't stream that, though, because it has a whole bunch of mod UI mixed in, and you don't want to see, like, well, I mean, you do. It's kind of drama, but I don't want to show, like, who flagged what, because those usernames do show up. Code and extra sounds painful to watch. User comments shows threads for deleted posts.

41:29The story was deleted, but user's comments make all the threads that they were invisible. The article should have the comments hidden from this. What are you linking to? Oh, you're linking to the user threads page. That's... I honestly don't know if that's a bug or a clever bit of... No, let's just show them only to the author. Yeah, let's work on this bug. This is a pretty good book. This one's clear. And let me just take a second to copy the tab over here so that I remember to close it after the stream. All right. So let's make a little demo. Let's show it. So what this looks like is, so we have this Laura Mipsom comment by this guy. photogabble we do something similar at work, we restore from production to an intermediate server, which runs a set of scripts to obfuscate PII before making the zips available to the dev team to use.
and if we go over to this guy's threads page yeah we see all these comments so i'm go well but i'm seeing the moderator view that's okay

42:59ah yeah photogabble that's pretty great so that bit of obfuscating pii that is fine for trusted users but i can't do that on stream because there are so many ways for things to leak out like if i show a timestamp well the site is low enough traffic that you can be like, oh, there was only one comment posted in that particular second. photogabble ah, yeah. That absolutely makes sense.
So now I know which one it is. And so there are like all those routes to de-anonymize stuff. And so I didn't want to do something like that on stream because, yeah, it would just be so easy. All right. So let's go ahead and set the user comments or threads for deleted post. Do I have a spec for user threads what did i call that route yeah so that's that's user underscore threads so let's say do we have a user thread spec already a lot of our functionality is just like basic crud stuff and so we're pretty thin on testing of it and i've been slowly improving stuff all right so not under that name we have like slash threads up here in spec dumb bug cobbler shoes all right let's just

44:49Yeah. Okay. So there's one and it's a feature spec, which is a little heavyweight for this, but that's how we spec whether we're logged in or not. So that's actually fine. Yeah. So let's take a look at that one.

45:13All right. So this break, this plugin, let's see if this works. yep broke that plugin i was recently tinkering with trying nvim and i broke everything in my vimrc and like half of my plugins so that one was super successful even though i use yadm y-a-d-m for managing my config files it was just kind of too painful to roll back because i'd been experimenting with other stuff when making other changes in those couple of weeks i guess i should have branched my local config files which is i mean that's some overkill but i could have so let's go ahead and say yeah so these are definitely one of these things is not like the other This one is different and does not belong. Let's go ahead and save this to a new spec called UserThreads, because I would rather have... I'll click on myself. I would rather have many. All right, so let's do that. And then I've got to reopen that. Requests, comments, and let's delete this out of here. Yeah.

46:47In my head, the words feature and request are basically synonyms, and so I keep opening the wrong test files. I'm a professional. Only been programming for 33 years. So, we're gonna have a feature of,

47:20What controller did I even put that on? It is on the comments controller. Oh, that must be how that ended up in that test file is I converted it from a controller spec at some point. Okay. So let's drop down to def user threads. Yeah.

...52I'm repeating myself. So let's just say the user threads page, which is at. So now I will know for sure what I'm talking about. We have to have a user. We have to have a story. We're going to need to have a comment that the user created on that story. That's fine. And then we will log in as that user. And if we are viewing parent apply.

48:42So this one I want to leave alone. And I want to say this is redundant.

...58All right, so this is...

49:18This is not threads, these are comments. See, look, I do have syntax highlighting. You see that little angry arrow is red? Damn, how much more color could you need in your editor? afoocado damn, I missed the color moment 8)
in seriousness that for me is the big value of having a very gray color scheme is the rare places where i use color it pops out let's just say this is only used down here and we will say put some

50:03afoocado ah, thought you actually spoke about the code itself
oh well i mean if you missed the syntax you can the color moment so there's a little yellow right here for the the git indicator line that says hey this is edited and then the other color moment was boy i can't even recreate my syntax error was it this yeah there we go i made the linter a little mad and down here at that last end there is a red arrow photogabble I think there was some red in a comment that had a @
But again, it's not big, but I don't want a lot of color. I want very few things so I can pay lots of attention to my code and just distract the shit out of myself by, I don't know, streaming and keeping an eye on two chat rooms. It only takes about 20 IQ off of my... Oh, yeah, there is red up here. Because, like, up at the top, because JS... I think that's spellcheck that JS is not in the... afoocado shouldn't it be JS, not js, if you're really spell checking?
spell checkers dictionary but that's a good word so now it is and then another place i see color in comments is i must have a yeah see there's another spell check and then yeah there we go that to do is kind of yellow so it's like a pretty chill there's a little bit of color there's a little bit of here and there afoocado jey-ess
it's just very very light touches shouldn't it be capital js if i'm really spell checking it should but i am okay with putting really lazy stuff in my spell checker dictionary where as a developer i talk about js and i don't even capitalize it a lot of the time because it's just its own word now So yes, that does mean I could send an email with a terrible typo and the word is, but I'm okay with that.

52:00Yeah. All right. So we should expect that we... Yeah, let's see it. And then let's get rid of it. So we'll see the text. Let's spell that right. And then we'll simulate. See, these features, people are kind of dogmatic about RSpec features. And they're like, oh, it should only interact with the site via real URLs. But then I want to do something here of let's have the story get deleted by a moderator. then i have to like log out the user because it's stubbed and then log in an admin which i also create like that's kind of awful so we're just going to go ahead and stop it so we're going to say story dot delete what's the name of this

53:14What do I even call this method? There's deleted. Not new domain. I'm looking for the method that gets called by the... there isn't a separate method right so there are a couple of layers of rails history here and i've tried to clean up stuff to the modern one but i think this one actually just leans on yeah on attributes instead of a method okay so we'll say story editor equals let's make a user who is an admin right that's what i called the trait

54:20They don't need to be an admin. They can only be a moderator, and that's clearer. And then we'll say story.delete. I just closed it. Merge down the changes.

...51Story params. Yeah. Let's just fake it. And we'll say find user story.

55:11This is the code I was looking for. I thought it was wrapped up in a method on story, but it's not. So we'll just say story is deleted. Screw. And set the editor. And then I guess as long as we're not properly doing validations inside the model, we're doing them outside, I don't have to do any of the other stuff. So we'll just say story.savebang. And now if we visit the story page, there's a method for this. What's it called?

56:01Short ID URL.

...13I'm only doing this extra. Let's comment it.

...39That means brittle.

57:03So we are the submitter.

...11Find the story.

...20And then. Here we go. If you're a user, we just find it otherwise. Say that.

...42I thought there was another missing. I think that's it. I think that's in the 404. The question was not found. There we go. The story had been deleted.

58:12If the, eh, I said none. Now let's check the thing we're actually here for and say we will visit this again and say we do not have that content. That's reasonable. Let's run it.

...49oh well let's get suspicious because tests never pass on the first run and if they pass on the first run you wrote the test wrong so why did that fail can't just say what's page body is that the api am i that lucky

59:24Am I running the wrong spec? I am running the wrong spec. I've confused features and requests again. There we go. This ought to do me the honor of breaking. Good. Ah, okay. So this, because you're the submitter, you're getting the better error message because you're logged in. So we'll say was removed. Now let's see what we get. I'm going to get my big debug if this passes. afoocado yay spam
photogabble I think you should mod one of us ;)
nope all right so we expected not to find the text common text visible and it's here good oh cool my first spam on twitch let's not approve that how do i there's a ban button right somewhere come on twitch why are you doing this afoocado not me, I have no idea how that works ^^
i can reply i can pin oh too bad photogabble logged out they seem to know the twitch ui photogabble where is the button hiding to delete this thing because i can see the chat i can see the activity feed i have the whole photogabble It's normally on the chat message itself
frici check your settings for show mod icons, click the cog and switch to mod settings
stream manager it is like not visible to you on stream but it's off screen right so i can see it is there like a second mod button here somewhere nope auto mod didn't catch cheap viewers on random domain it's normally on the chat message itself Check your settings for show mod icons. I bet that's it. Yep. Aha. Well, thank you very much, Ricky Freesy. photogabble yeah, you need mod icons set to show or be in mod view.
That is definitely what it is. So there is a warn. Which one of these is spam? Oh, let's ban. Ban is good. frici *free chee* but any way is fine LUL
Cool. All right. I guess. photogabble it shows as message deleted by a moderator
So for you viewers, did the Twitch chat remove that or do you still see the spam in your scroll back? Because for me, it took it out, but I can't actually see what the stream review is. Shows as message deleted by a moderator. Great. That's exactly what we want to see. Cool. Thank you for your help with that. I appreciate it. Is there anything else in the chat settings that I should already have turned on? Show mod icons and actions, chat appearance. Whoa, that's awful, okay. Yeah, that looks like everything I want, great. right so with that spam bot so you know somebody already joked about how lobsters has the whole invite system and that was a good demonstration why is there are so many spam bots that otherwise we would be infinitely buried in spam and then i guess the secondary reason is like we would be infinitely buried in users if a more popular site linked to us so like once or twice a year hacker news links to us and then People are mad they can't conveniently sign up, but then. Also. I'm trying to think of how to say this diplomatically. afoocado don't say it diplomatically! :D
Occasionally, the general tenor and content of those comments will also remind us why it's valuable not to have our culture immediately overrun. So. Now let's go over to the comments controller. and make that respect deletion. So we just say, let's find the user. Let's find the recent threads for the showing user that are accessible. Accessible. This should actually be enforcing.

01:04:10Yeah, that looks like a pretty bad bug. Let's go ahead and say... We don't actually need to be logged in for this, do we? And we don't want to be because I don't want to be confused by whether the user is allowed to see their own deleted comments. I think at least for the moment, I don't want them to. All right. Don't say it diplomatically. Yeah, I'm not trying to be spicy and... afoocado low cut shirt, sitting next to a pool while coding <3
photogabble spicy enough? naw, you would need to be programming from a pool in your living room
get a whole hell of a lot of viewers if i did that you know if i really wanted that i would just wear a low-cut shirt is that spicy enough for making fun of twitch let's see so this still displayed the comment text so let's go look at that scope because that scope is not working right afoocado and spam the chat with your linktree/OF
yeah it's got to be the scope right because we should only see comments that are accessible oh accessible to user doesn't respect whether the story is deleted that's what it is okay yeah i think the the spiciest thing that i'm gonna be streaming is gonna be if my cat shows up on the stream he is not currently in the room but when he wanders by i'll show him oh right my my only fans yeah honestly the i did mark the channel as i don't remember what twitch called it but i did said that i'm probably gonna end up cursing at something on stream at some point Because sometimes I work blue, but that's about that. afoocado exposed nerd showing everything (meaning ugly code/bugs)
So this has got to say that accessibility user should not include. Oh, I guess I have the AutoMod turned up. afoocado lol
frici automod can be very touchy
Yes, Avocado is allowed to call me a nerd, AutoMod. So yeah, the other thing I wanted to do to Avocado's comment there is I am actually streaming in part to take away the mystique of programming. photogabble I sometimes watch lastmiles streams, he can get very marmite at times.
There's a lot of dumb typos. And you've already seen me three or four times on stream grab the wrong file name because I keep forgetting request first feature because it's one of those things that Rails only changed five years ago. And so I'm catching up to the change. So if we have a user and they are the moderator, or they only get active, and active is not deleted or not moderated, this is probably going to blow up half the site if I say joins story.where. Is it merge? Is merge the name of that? so many things yes it's called merge so if i said merge story dot what's the name of that scope photogabble sorry i don't know who last miles is and you'll have to tell me if it's freaky or fritchy crazy photogabble he is a greybeard unix dev
but yeah i kind of turned auto mod onto like fairly high settings because i don't know i just figured it would be reasonable where's my scope there's my scope not deleted

01:08:47frici hard *ch* yeah chee as in cheese HahaSweat germanic names can be difficult for americans don't worry :P
afoocado I'm German, didn't recognize that name as "germanic" at all ^^
this let's take a user so if i'm going to say that then this has to change to also take a user hard ch as in cheese okay so fritchi well fritchi for what it's worth for pronouncing german names i'm in chicago which is the center of like an enormous wave of german migration what a hundred 20 years ago so you'd think we'd be pretty good at it we do have in chicago a street named for the famous author spelled like this pronounced at least in chicago as gerta which is not quite the german pronunciation but it's enough that you can play spot the tourist why did you change that to dot call standard that's not equivalent

01:09:49Okay, didn't change it back. It got a little confused. frici @afoocado It's a Hungarian diminutive/shortening of Friedrich
Oh, the Germans are fighting in the comments. I'm going to stay out of proper German pronunciation, I guess. Anyways, as to Last Miles being a Greybeard Unix dev, you are watching one. My vimrc is probably older than half the viewers, at least. afoocado ah, that name I do recognize, we just don't use that shortening here
So let's see. photogabble i knew there was a reason why i was still watching haha
So if we do that, afoocado "Fritz" if anything
I mean, that might fix this spec, but it might also blow up like half the site because so many scopes build on each other, wrong number of arguments, because I didn't change it down here where I said active. Now that means this is going to ripple. And so every place that I might call comment.active is going to blow up.

01:11:10Wrong number of arguments, given 0, expected 1. Let's actually look at the traceback. Comment 43. Yeah, this is an example of it rippling out.

...36why are you saying given zero expected one when i gave one see the thing about this is it doesn't say which function call expected one argument and got zero

01:12:06Let's narrow it down. Let's just do the wrong thing, and then at least we'll get a different error message.

...43Okay, we got the same error message, which is hope that it's this or that it's not that. User thread spec. Let's go look at that update cached columns. Story 848. I don't know why that's in my trace because I modified. So there's a. lot of callbacks in this code yeah there it is is there a way to i can mark this as optional like that so it doesn't blow up half the code base that calls comments.active right here we go and that's actually good because then i get the behavior i want all the time i think let's think through that after this test column is deleted and where clause is ambiguous. Oh, no. So this is one of those limitations of active record. So I'm building on this not deleted scope. And it says where is deleted is true and. There also is that on story. And so as soon as I'm joining in the story table and saying, oh, merge in story.notdeleted, well, story.notdeleted just says this. It's not scoped to.

01:14:40Oh, it must be because I'm doing this string here. So if I could get this little string predicate reformatted into the active record query API where it's the key value type, it probably will maintain context. So why did I do this? So I could say that the submitter or the moderator, oh, this is actually not what I want here. So we're just going to punt on that. We're just going to say, I don't want the user to see it either. Well, I don't know if I want that. right so the alice leaves a comment on a story that she submitted the moderator comes and deletes the story should alice see her own comment on her deleted story because the test is written now is can bob see alice's comment and that one is Unquestionably, no. But should Alice see her own comment? I kind of lean towards yes, because I want people to be able to retrieve their own comments and their comment wasn't deleted. So yeah, I think I do want to use this merge. I think that is reasonable. So we'll say not deleted for this user. And then here, we'll go ahead and duplicate this because I'm going to break it in a second. So I like to have it in front of me so I can remember what I just did wrong. So let's say where is deleted is false. Oh, I'm really trusting the OR. And I never remember this syntax. So let's spend a second here. So let's grab the last story because that's going to be test data, right? Test data. So for the user, what do I want to check? I want to check that I can say, I want to see the SQL out of this. So story dot let's go ahead and say so let me know where id is and for a unix graveyard that may have been weird that i grabbed that instead of retyping but i've made so many typos i've just learned i should always copy and paste when i can so let's just grab this story and then we're also going to filter and say, where is deleted is false. Good. I just want the sequel and put, so I don't see quoting. Good. And then is it dot or where.

01:18:21I think it's like this.

...30So then I get the story is this and or. See that these parentheses are not where I expected. What if I just said this? Now that's reasonable. That's what I want. but it's not like ActiveRecord exposes the relational algebra. So I always have to like stop and kick it a couple of times to figure out that I'm expressing things in the way it expects. So what I'm trying to say is story where deleted is false dot or. All right. Let's just go ahead and grab that. Yeah.

01:19:25So you have to have a user. So we could get in here if there isn't a user passed in. So then this has to be that. But if I pass in a nil, are you going to get something reasonable? Because that'll become nil or user ID is null. So that won't match anything. OK.

01:20:06At some point, this wants to be not a ternary so that I can actually see it. The other hand, the line isn't this long because I've still got all this stuff in. So I did user try ID. So I would pass a zero. That's fine. I get a not matching either way.

...43How do you like that?

...52So that says where the story is deleted or the user is the submitter. And we handle moderators in the other branch. Because we're not joining the users table. And what is my red arrow up here? Syntax error. Syntax error. What parent did I not close?

01:21:42okay so it's in there story dot not deleted how am i missing a okay it was actually fine standard was lying to me so this is the thing that every once in a while happens to ale where it remembers that there's a syntax error because i exited insert mode at some point while i was halfway through the edit and then it kind of caches that and even after i go and put in The syntax fix, it still highlights that line as wrong. I don't know why that happens. It does happen occasionally. But it's super irritating. All right, so let's see. I don't need that anymore. Let's see if the text wants to run.

01:22:39What did I break? Is it not called isDeleted? Where is deleted is false. Change to this.

01:23:02Hold on. That's not right. Unknown column stories dot is deleted in where clause. But it has one, right? No, we're not quitting them.

...41yeah yeah that absolutely exists okay i'm not losing my mind this is this is a totally misleading oh it's forgotten that i bet it didn't remember to join against stories and so when it says stories dot is deleted or it generated a sequel where it renames the tables but it doesn't know that when it runs the other part of the query so I think what's happening is this part of it does the naive, let me insert the name of this model as the, let me insert the database table for this model. So that goes story.isDeleted equals false. But then all this gets compiled. And when the joins happen up here, the .join, it's renaming the, table so that it can run them all together. So let's look at that. What if we said comment.active.toSequel? No, it did not alias the stories table.

01:25:16Yeah, okay, so that part is fine. So that's not what it is. If it's not an issue with table aliasing...

...35It's a puzzle. What if I pass?

...46Yeah, down the other branch, we still get... What did we say? Let's pass the admin. Get the same thing. Okay. Hmm. Oh, that's the lazy loading thing.

01:26:30Let's figure out where that error is coming from. Let's just say all here, because if we say all, then we won't try that join, so we don't get that error. But if we have that there,

01:27:05I should get that error again. Yeah. So one benefit of switching over to this is I can just slop some debugging in here.

...27Yeah, I think I can do that.

...47This says the right thing.

...59So in user spec line 10, call story 854. And let's go look at 854. That's the one thing I haven't done.

01:28:14Calls merged into story.

...23Yeah, that's just a relationship.

...44So this is 854.

...53Is it actually mad about this? Because this touches that active. What if I pass, explicitly pass nil here? That shouldn't change anything. Really shouldn't. I'm just kind of kicking stuff without understanding why I'm getting that error. So I don't deserve to have my tests pass yet.

01:29:23Unsupported argument type. OK, I thought I could. If I just said. Where? stories this should at least get me past the syntax error and it won't do everything i want but it gets me past the syntax error right or this spurious error about the column not existing no i'm not even editing the right thing okay that's surprising So you're not grumpy about that, you're grumpy about this.

01:30:42Yeah, I've only changed like three lines of code, so it's got to be one of these.

...54All right. So let's go ahead and put that back because that's not it. And down here.

01:31:24Let's swap these.

...45Bugs while fixing bugs are the best kind of bugs.

...56But if that's still broken, then it's this thing, right? There just aren't that many changes. Yeah, OK, it's that.

01:32:22When we merge against the comments story,

...33Somehow, it's got to be the table aliasing thing, but the put statement didn't show it.

01:33:07And when I called it from... What if I move this up a layer? Because I was worried about this breaking half the site anyways. So if I said here, I said...

01:34:12So if we called that set, can't type the word filter. And then here, I just get rid of that for now.

...41That ought to do it, right?

...49Wrong number of arguments, given 0, expected 1, because I changed the story interface.

01:35:11Did I change the story interface?

...27No, it took a user before and it takes a user now. saying all takes a user oh that might be true for users

01:36:20This one, that's where it is. That one needs to say user. OK. Makes sense.

...35OK, test is green. Let's clean up. Do I want to include this story change? Let's see how much of the site blows up if I change that. So put that back. Didn't mean to increase the font size. Okay.

01:37:11It says, oh, it's a legit standard RB syntax error. I left off the thing. All right. I left it in the extra. So that's, Good. And this should be a no-op, but boy, am I suspicious of touching such a high value, high traffic scope. So let's put that back for the moment, and I'll think about it. And hold on, stop, stop. There's so much debugging in there. I don't need to see the whole. So let's go to spec, features, user threads, and get rid of this puts. There we go. All right, this ought to be green. Oh no, why are you back?

01:38:29Did it need this refactor? Didn't think so.

...37It needed that refactor. Okay. Okay. Let's look at the whole diff. So this thing checks to filter stories. Active. This is dead code. I could drop that. This matters. And that's just me moving the test. All right, so let's see a green sweep.

01:39:21One failure.

...27One failure, and it's the preview spec I just added for the previous bit of coding.

...39Oh, it's two failures. Check URL dupe failed. Yeah, this is the kind of random spec I expected to fail for touching that scope. I broke preview?

01:40:16Something really sensitive to whether I say null or zero there. Because that 2i on the end of a user not present is nil and nil.2i is zero. No, that didn't change behavior. So it's something about changing the scope and refactoring it, which is not great. So this is dead code. That's dead. That's fine.

01:41:12Yeah, now I didn't even touch comment.

...26So the question here is how that blew up story pre-use that I just worked on. And push. Or...

01:42:02I need to run it again. I got it up here. Expected to find preview shown.

...18But what's happening is I'm blowing up all the stories and not showing any stories. No, that would... There is a smoke test for the homepage. It took us like Eight years to add a spec that just the home page loads. A little oversight there.

...42So if I go. Easy plugin if I go back to the old code.

01:43:01That's no more. Everything related to user threads failed.

...14The two user threads failed and the homepage and previews is still broken. That implies I didn't get previews working and it's just failing for funsies, doesn't it? If I stash save and run the whole suite, did I just break the build on the last commit? Is that all? This test doesn't actually work? Cool. I broke the build.

01:44:05Is it one of those where it works in isolation?

...18It doesn't even work at all. That's great. That's super great. Does GitHub show that it works? What does it show that I broke? Ooh, I broke it. What a great stream. Break the build. Let's pop the stash. Let's get everything into the stash. Oh, wrong thing. So now I'm just at adding the spec.

01:45:07And that spec is wrong. So let's finish whatever I did wrong in this, that it's not showing the preview. And then I can pick up the other thing with a clean slate.

...25Oh, I wanted to see the test fail and I left it commented out. That'll do it. Okay.

...49All right. Let's reorient. Where is this build? So hopefully just the two user threads are failing and they're failing in a way I can fix without touching a core scope that the whole site uses. Yeah. All right. So we're back to this. And the traceback is incomplete because it's showing where that query got triggered rather than where that query got made. So if we go back to the comments controller, it's here.

01:46:42And if I don't merge this in, the one user thread should pass and the other should fail, but that it's like failing that it's not implemented rather than throwing an exception.

01:47:05Yes. Okay.

...16So it doesn't like that I'm merging in story.notDeleted.

...26What if I merge it in as...

01:48:02See, that looks like it should work. Maybe that's the issue is I'm trying to merge in that story thing directly instead of merging it kind of nested under the comments has many. Two fails. I can go ahead and just run the user thread spec at this point.

...37And I run just that for faster feedback and it goes for can't quote hash. What did I type wrong here? Where comment go to story is deleted is false allowed to nest these things. It's not that right. Can't quote hash.

01:49:24I'm going to change it to... Is that run?

...47Let's put argument type ops. I just want to. that it is running story.

01:50:09Can I refer to the scope?

...18No.

...49creating things. Let's leave that commented out for a second. Let's back up more to where it sort of worked. And then here on the comment, it's already on the comment because we're in that context. Let's just say where the story is deleted. Yes. So we don't need that herb.

01:51:24Good. All right, so working code after all of that struggle. So what's the difference here? It's whether I'm saying merge the thing or do a where. So let's just say that the story filter is nothing if you're a moderator otherwise it's that should still work oh

01:52:37Oh, it's it wants to be. To actually use the value I set, not just mention it and never use it. OK, and then I have a green build, right?

01:53:01I've got a green build. But I've only fixed the one thing.

...13so here i can say if you are the moderator or this is where i want to say or

...48This is where I want to call the NotDeletedScope. And calling the NotDeletedScope those things up.

01:54:16Well, I guess I could just say the submitter doesn't get to see their own. But that's no fun. Or I could say if they... Because this has to join against the submitter. Yeah, let's just punt on that. Let's do the simpler thing for now, and I will come back and break it more later. So let's... review the diff, and drop that change to add a little story.

01:55:12And the Lobster's chat room is figuring out going on with defcon cool all right and then this should be green right good what was this ticket number this was 1243 all right so say fix 12 40 three and describe what i did what did i do besides break a bunch of stuff and get annoyed at active record i said that don't show comments on gated stories user threads

01:56:18okay so i took one test out added a second one brought that there let's just see it one more time that i didn't break the build so this this little command i ran here is basically what's in the github action for check.yaml to that is whether our build is green or not. There isn't a convenient way to just run those from the command line by introspection, so I've just repeated it. All right, good. Well, then we can push that up. And then GitHub should say... Did I not type 1243 correctly? one oh i forgot that i forgot the pound sign so it didn't take that so anyways this is fixed that's fine great so i've been streaming oh just shy of two hours and i've fixed two bugs and probably only introduced one along the way i feel like this is a pretty good tech demo afoocado <3
frici productive !
And I cannot imagine being one of those people who streams for 12 hours a day, my voice would be destroyed. So I think I'm just going to call it here. I'm going to call this a very successful tech test where we debug some stuff, wrote some real code, got the stream working, Avocado caught that I had a, Layout issue, I even managed to edit my awesome config without blowing it up, which is great, because I don't really know Lua. I only kind of know Lua. So that whole streaming layout that I showed for a minute was just like me taking one of the built-in ones and kicking it until it roughly did what I want. And then, yeah, this feels like a really good place to leave it. afoocado thanks <3
Thanks very much, folks who dropped in. Affocado, I will send you an invite in a minute. And then who was it that helped me? Was it... Oh, Fritchie, I see you're still... Fritchie? I see you're still here. You helped me with the... figuring out why I couldn't boot the spammer. pushcx https://lobste.rs/~pushcx
If you would like an invite to the site, just... Find a way to DM me your email address here. I will put in the chat. Here's a bunch of contact info for me. And there are a few enough people watching that I'm not worried I'm going to get fakers. frici I am not gonna doxx myself but I'm a longtime user of lobste.rs actually.
So just send me your email address somehow and I will send you an invite to the site. frici from the time joshua started it
That's about that. Let's see if I can remember how to end the stream. Thanks very much for hanging out, folks. Have a good weekend.