2019-09-04 08:05
█████ came into town yesterday. I've been trying for awhile now to acclimate my brain to using their new name and the proper pronouns, it's like rewiring well-trod paths, and I feel I've gotten better at it, but of course last night I ended up using the wrong pronoun. I'm not sure they noticed since there were a few people talking simultaneously, but it's one of those things I immediately felt bad about.
I saw at least 4 spotted lantern flies yesterday around/on the house. They are kind of hard to miss, being large and partially bright red, but it does feel like an invasion. We don't have a lot of trees at our house, but it's getting to be the time I'll need to pay attention to the ones we do have for the eggs (not clear at this point what one does to kill the eggs if you find them attached to a tree).
At work I've been spending a long time converting the chat app I work on from a single server deployment using a lot of in memory storage, to a load balanced multi-server deployment that cannot completely use in memory storage. We are using Socket.io for handling the websockets with the fallback to xhr polling for those with older browsers (like many of our customers unfortunately), and I've been implementing an adaptor that uses Redis pubsub to handle communication between servers. Because the pubsub calls are asynchronous it's forced me to use a lot more asynchronous functions in the code. So I've been getting a crash course in Promises and async/await functions, which I had previously read about but not used much. Oddly, the hardest part at times was figuring out how to write decent unit tests for those functions. I still have a couple use cases where I just can't seem to get the unit tests to coverage certain situations (particularly the catch blocks). I do really enjoy working in node though, the freedom to not think about browser compatibility allows me to learn a lot of javascript that I have not otherwise been able to implement, such as Classes. I've been working on this issue (the load balancing) for more than a week now, I think I might have literally changed every file in the repository. Client testing is brutal too. Normal chat testing can be a total pain as I tend to have to open multiple tabs for operators and patrons in the chat, as well as a utility I have for monitoring logs. But with multiple servers, not yet load balanced, I also need to think about which connections are going to which servers, so I can make sure the cross-server communication is working. I am going to be so glad to be off all next week.
█████ at work asked me for advice as a senior developer yesterday, which oddly synced with me thinking the other day (the 2nd) about finally feeling like I know what I'm doing. And now I'm realizing I need to code an easy way to link between entries on the site, so I don't have to try to type in links.
I've also been thinking about other/better ways to handle the tags and archives in the site, as right now, showing all the content for all the entries in a month or tagged with a specific tag can generate lots of text and will require those pages to update every time I add a matching entry. Trying to come up with an effective async way to handle those types of pages that won't require a server backend. I was thinking if the archives were only a basic framework that used routes to load the archives, I could return or store in the page just the references to the posts that fit the archive/tag, then I could load them asynchronously if I had a json representation of each entry (so each entry would have a html and a json version). I could even load as you scroll or something so it was just "load tons at once". Or just a "load more" button that grabs a few at a time.