2022-06-21

mindstalk: (anya bunny)
It is commonly believed that when dealing with an ornery bug, just explaining the problem out loud to someone else often grants insight. "--oh, I see it now, sorry to bother you." So much so that, supposedly, one senior engineer required juniors to explain their problem first to a teddy bear, the 'bug bear', and only if that failed could they bother him.

I haven't actually used this much. Mostly been on my own, and my default approach to bugs is more logging. But I was playing with TypeScript and Koa today, and had a problem that didn't work for: the main code worked fine, but if authentication failed, the server seemed to never respond to the caller.

I was about to find a senior active on Slack, to ask for help, when I thought of the bugbear. I did not have a teddy bear, and I don't think I even said anything out loud, but I did go line by line, trying to mentally verbalize what was happening and what the point was. And yes, found something suspicious: "ctx.response = 401", which looks like it's trying to set a status code but is clobbering the response object. And yes, "cts.response.status = 401" fixed it. Voila! No seniors disturbed.

Profile

mindstalk: (Default)
mindstalk

June 2025

S M T W T F S
123 4567
891011121314
15161718192021
22232425262728
2930     

Page Summary

Most Popular Tags

Expand Cut Tags

No cut tags

Style Credit

Page generated 2025-06-05 07:53
Powered by Dreamwidth Studios