JoeSondow

dice.camp

<p>📺 Streaming <a href="https://twitch.tv/JoeSondow" target="_blank" rel="nofollow noopener noreferrer"><span class="invisible">https://</span><span class="">twitch.tv/JoeSondow</span><span class="invisible"></span></a> 🀄 Board Games 🚀 Star Trek 🦝 Interactive Fiction 🧩 Puzzles 😸 Cats 🎲 TTRPGs 🕺 Dance 💊 Migraines ♂️ He/Him 🤖 Bot: 🧔🏻 <span class="h-card"><a href="https://botsin.space/@RikerGoogling" class="u-url mention">@<span>RikerGoogling</span></a></span> 👨🏻‍🦲 <span class="h-card"><a href="https://botsin.space/@picardtips" class="u-url mention">@<span>picardtips</span></a></span> 😠 <span class="h-card"><a href="https://botsin.space/@WorfEmail" class="u-url mention">@<span>WorfEmail</span></a></span> 🧊 @LocutusTips@botsin.space 🖖 <span class="h-card"><a href="https://tenforward.social/@StarTrekHour" class="u-url mention">@<span>StarTrekHour</span></a></span> 🐠 <span class="h-card"><a href="https://botsin.space/@EmojiAquarium" class="u-url mention">@<span>EmojiAquarium</span></a></span> 🌺 <span class="h-card"><a href="https://botsin.space/@EmojiMeadow" class="u-url mention">@<span>EmojiMeadow</span></a></span> 🐐 <span class="h-card"><a href="https://botsin.space/@TinyPettingZoo" class="u-url mention">@<span>TinyPettingZoo</span></a></span> 👸🏻 <span class="h-card"><a href="https://botsin.space/@EmojiPrincesses" class="u-url mention">@<span>EmojiPrincesses</span></a></span> 🧱 <span class="h-card"><a href="https://botsin.space/@EmojiTetra" class="u-url mention">@<span>EmojiTetra</span></a></span> 🐍 <span class="h-card"><a href="https://botsin.space/@EmojiSnake" class="u-url mention">@<span>EmojiSnake</span></a></span></p>

Recent twts from JoeSondow
In-reply-to » @JoeSondow If Amazon thinks retrying a function is idempotent, then wouldn't best practice be to make that true? By storing "I posted today" somewhere maybe with a Mastodon post ID? But if you have no database set up then that would be a lot of trouble...

@aburka@hachyderm.io Their contract is just, if you throw an error, they’ll retry, so don’t throw an error if you don’t want a retry. It’s fair. Just means you gotta wrap your stuff to prevent an error throwing if you think there’s any risk.

⤋ Read More
In-reply-to » @baralheia I’m not sure it is possible on this end. Anyone can spin up an alternative instance of bird.makeup that doesn’t honour that since it’s open source. Stuff like that should be implemented on Twitter’s side

@vincent@social.librem.one Repeatedly responding to requests for you to stop stealing artists’ work by saying that other people could theoretically steal their work and therefore you will continue to do so is, the nastiest, slimiest, most vile way to respond. I hope you get sued.

⤋ Read More
In-reply-to » 7. So how do we fix the problem? Add some logic to check whether each bot has any content scheduled for today. If no content exists for today, don't assume there is any, don't try to get today's content for that bot. And for good measure, since I might add another bot into this function years from now and forget about this issue, wrap the whole function in a try-catch block to log any errors without reporting them as failures to AWS. Better too few posts on a bad day than a bunch of duplicates.

8. That last bit isn’t a good practice in general, but for something like this, it doesn’t have much downside really.

⤋ Read More
In-reply-to » 6. This also explains why @LocutusTips hasn't been posting yet. I've been waiting for it post on schedule (once every few days) before announcing its existence, but it hasn't yet. The reason is that I scheduled Locutus to post on days when Worf doesn't, and vice versa. So on Locutus's posting days, Worf had no content for the day, and so threw a NullPointerException, halting the program before Locutus could get a chance to post.

7. So how do we fix the problem? Add some logic to check whether each bot has any content scheduled for today. If no content exists for today, don’t assume there is any, don’t try to get today’s content for that bot. And for good measure, since I might add another bot into this function years from now and forget about this issue, wrap the whole function in a try-catch block to log any errors without reporting them as failures to AWS. Better too few posts on a bad day than a bunch of duplicates.

⤋ Read More
In-reply-to » 6. This also explains why @LocutusTips hasn't been posting yet. I've been waiting for it to post on schedule (once every few days) before announcing its existence, but it hasn't yet. The reason is that I scheduled Locutus to post on days when Worf doesn't, and vice versa. So on Locutus's posting days, Worf had no content for the day, and so threw a NullPointerException, halting the program before Locutus could get a chance to post.

7. So how do we fix the problem? Add some logic to check whether each bot has any content scheduled for today. If no content exists for today, don’t assume there is any, don’t try to get today’s content for that bot. And for good measure, since I might add another bot into this function years from now and forget about this issue, wrap the whole function in a try-catch block to log any errors without reporting them as failures to AWS. Better too few posts on a bad day than a bunch of duplicates.

⤋ Read More
In-reply-to » 5. In my function, that means Picard maybe posts, then Riker, then Worf, then Locutus. If Worf logic throws an error, Riker has already posted, and the whole function is going to run again because of the error, so Riker will post again before we hit the Worf error again. If Worf posts and then Locutus throws an error, same deal; the function will run again, Worf will post the same thing again, and Locutus will throw the error again. That's what happened.

6. This also explains why @LocutusTips@botsin.space hasn’t been posting yet. I’ve been waiting for it to post on schedule (once every few days) before announcing its existence, but it hasn’t yet. The reason is that I scheduled Locutus to post on days when Worf doesn’t, and vice versa. So on Locutus’s posting days, Worf had no content for the day, and so threw a NullPointerException, halting the program before Locutus could get a chance to post.

⤋ Read More
In-reply-to » 5. In my function, that means Picard maybe posts, then Riker, then Worf, then Locutus. If Worf logic throws an error, Riker has already posted, and the whole function is going to run again because of the error, so Riker will post again before we hit the Worf error again. If Worf posts and then Locutus throws an error, same deal; the function will run again, Worf will post the same thing again, and Locutus will throw the error again. That's what happened.

6. This also explains why @LocutusTips@botsin.space hasn’t been posting yet. I’ve been waiting for it post on schedule (once every few days) before announcing its existence, but it hasn’t yet. The reason is that I scheduled Locutus to post on days when Worf doesn’t, and vice versa. So on Locutus’s posting days, Worf had no content for the day, and so threw a NullPointerException, halting the program before Locutus could get a chance to post.

⤋ Read More
In-reply-to » 4. My first guess was that AWS Lambda had a scheduling bug. They've had them before. I checked the logs and saw the program running three times at the problem time instead of once. But I also noticed a NullPointerException in each execution log. NullPointerException is Java for "you done fucked up, A-A-Ron." First I thought Amazon was having an error and I was also causing an unrelated coincidental error, but no, this time it was all me. Amazon just retries the function if it throws an error.

5. In my function, that means Picard maybe posts, then Riker, then Worf, then Locutus. If Worf logic throws an error, Riker has already posted, and the whole function is going to run again because of the error, so Riker will post again before we hit the Worf error again. If Worf posts and then Locutus throws an error, same deal; the function will run again, Worf will post the same thing again, and Locutus will throw the error again. That’s what happened.

⤋ Read More