Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
43 posts
Clear filters·6 min read

TaskPad · Story
TaskPad's session restore could register a window it never showed
Restore created each window first and checked its tabs later, so a failure could leave a hidden window in the workspace. I rewrote it to validate before creating.
In short
- Session restore built each saved window up front and cleaned up empty ones afterwards, so a failure midway could leave a hidden window registered in the workspace.
- I split restore into parse, validate, create: a window is only made when at least one of its tabs can really be restored, and anything that fails is logged and rolled back.
- The save side and the single-instance handler now ignore invisible windows too, so a hidden one cannot be saved, or receive a file you double-clicked.
#wpf#csharp#session-restore#debugging
·7 min read

Chiti · Story
A courier who stood still stopped receiving offers
A courier waiting for work stopped seeing fresh offers. It took four causes to explain it: a 250 m distance gate, a location provider that never answered, a false status and a stale cache.
In short
- The server ranks a courier's offers around their last stored position, so a position that stops updating quietly freezes the feed.
- Four stacked causes: a 250 m distance gate, a location accuracy setting that some devices never answer, a screen that claimed to track when nothing was running, and a persisted cache shown off shift.
- Each fix is small. The work was following the symptom through app state, OS settings and server ranking.
#react-native#expo-location#tanstack-query#debugging
·6 min read

Chiti · Story
The server took every position and stored none of them
A courier's marker moved on the map while the server quietly kept an old position. I made position reports acknowledged, then taught the socket to reconnect when the answer was stored:false.
In short
- The backend stores a position only for a socket whose handshake proved an identity, so an anonymous socket can broadcast a marker and persist nothing.
- Positions now go over the socket with an acknowledgement, and the client remembers whether the server says it stored them.
- When the answer is stored:false, or when the token changes, the socket reconnects once so the handshake reads the current token.
#socket-io#react-native#auth#reliability
·6 min read

Chiti · Story
A 10 second timeout failed an 11.3 second handshake
A socket timeout that looked generous lost every frame during reconnects. I measured the server's handshake at 11.3 seconds and moved the budget to 25.
In short
- The socket connect timeout was 10 seconds. The server's handshake measured 11.3 seconds, so the first attempt failed on exactly the connections that needed patience.
- Every failed attempt cost a full reconnect cycle with no frames, and the server replays nothing.
- I raised the budget to 25 seconds, above the server's own 20 second ping timeout, so the ping cycle decides when a link is dead.
#socket-io#react-native#debugging#timeouts
·5 min read

DailyBrief · Story
A stray PowerShell error turned my digest into 391 MB
One unsuppressed script call inside a foreach expression put a .NET error object into DailyBrief's digest. The same commit fixed a Georgian text repair that had never worked.
In short
- A call inside a foreach expression leaked an error object into the captured array, and ConvertTo-Json serialized its whole object graph.
- The fix is $null = ... 2>$null, plus a comment so nobody removes it.
- fixMojibake inverted a cp1252 corruption with latin1, so it always rejected its own output.
#powershell#debugging#encoding#electron
·5 min read

DailyBrief · Story
Every AI run died in 2 seconds, and nothing said why
A one-kilobyte stub where the claude binary should be made every DailyBrief run end silently. The fix was checking file size, and a second silent failure taught me the same lesson.
In short
- After a global npm install, claude.cmd was present but bin\claude.exe was a tiny text stub that Windows refused to run.
- Test-Path says yes to a stub, so the fix checks the binary's size, in one shared file instead of four hardcoded paths.
- Five days later a swallowed ENOENT made the app blame the CLI for a problem it did not have (c452d06).
#powershell#windows#claude-cli#debugging
·5 min read

DailyBrief · Story
Stripping claude -p down, then planning with Haiku first
A plain headless Claude call carries about 30k tokens of my own setup. A lean runner cut the recorded baseline to about 1.2k, and splitting code execution into two models cut its turns.
In short
- claude -p loads your whole personal setup. core/claude-run.ps1 switches each part off with a flag.
- The script comment records a baseline of about 1.2k tokens instead of about 30k, taken from the code and not from a benchmark I ran for this post.
- Code execution became two calls: a Haiku plan with read-only tools, then a Sonnet implement call with 25 turns instead of 40.
#claude-cli#powershell#ai#cost
·5 min read

DailyBrief · Story
A 72 MB upload kept dying, so I moved releases off my laptop
Pushing the DailyBrief installer from a home uplink took 14 minutes or ended in ECONNRESET, and left tags with no files. A tag-triggered GitHub Actions workflow made the upload local.
In short
- electron-builder created the release first and then died uploading the installer, leaving a tag with no assets.
- A GitHub Actions workflow now builds, tests and publishes on a runner that sits inside GitHub's network.
- scripts/publish-assets.js stays as a manual repair path, with the sha512 the updater checks and retries on every upload.
#github-actions#electron#ci#auto-update