Build Log

A Collection of Missteps (DevToolStack Dev Log #7)

7개 층을 모두 쌓아 올린 시리즈 커버 — 마지막 층이 놓인 상태

Over six posts, I wrote about what I built and how. This last one is about what I got wrong. I picked five, and once I laid them out, they turned out to have something in common. The failures that threw an error and died were actually the ones I fixed fast. The ones that took forever were all cases where something was silently wrong, with no error at all.

1. The Screen Just Kept Showing the Old Version

I built a new admin dashboard and wired it in. I refreshed the page, and the old screen was still there.

I went back through the code. The path was right, the file existed. I deleted and rewrote it a few times — same result. It took a while before I finally opened the server logs and found out why.

getFromImportMap: PayloadComponent not found in importMap

The CMS I'm using only recognizes a custom screen if its path is registered in a separate import map. You have to run a command to generate that map, and I hadn't — so it couldn't find the new screen.

The real problem was what happens when it can't find the screen. If it fails to load the component, it just silently falls back to the default view. The error only shows up in the server logs — nothing appears in the browser.

There was no way to tell whether the screen I was looking at was "the new code didn't take" or "this is just what it's supposed to look like."

2. Korean Characters Ended Up in the URL

I set it up so that typing a post title automatically generates its URL slug. Testing with English titles, it worked fine. Then I tried a Korean title, and got this:

/posts/postgres-17이-sqlite를-능가한-지점

Technically nothing was wrong — the browser handles it fine, and it saves correctly. But copy that URL and paste it anywhere, and it turns into an unreadable wall of characters.

I changed it to pull out only the Latin letters and digits from the title and chain them together.

Result
Before postgres-17이-sqlite를-능가한-지점
Now postgres-17-sqlite

3. It Worked at Home, but Not on My Phone

3.1 A 20-Second Request Kept Getting Cut Off

I was out, opened the admin on my phone, and asked the AI to touch up part of a post's body. I got "Failed to fetch." On my laptop at home, it worked fine.

A single AI call takes around 20 seconds. The setup kept the connection open and waited the whole time. But on a phone, if the screen locks or you switch to another app, it kills whatever request is in flight. The server was still happily working away — only the client had given up.

I changed the architecture. Now a request immediately returns just a ticket number, and the result is fetched with short polling calls. There's no more long-lived connection to lose.

sequenceDiagram
  participant Phone
  participant Admin
  Phone->>Admin: Fix this paragraph
  Admin-->>Phone: Ticket (immediate)
  loop Until done
    Phone->>Admin: Is it done yet?
    Admin-->>Phone: Not yet / Result
  end

3.2 I Fixed It, and It Happened Again

A few days later, the same error showed up again. The symptoms were identical, so at first I thought the fix hadn't actually taken.

It turned out only half of it was actually fixed. I'd gotten rid of the long-lived request, but the polling logic was written to give up entirely on a single failed poll. Switching apps killed whatever poll happened to be in flight at that instant — and that one failure was enough to end the whole thing.

There was a second bug on top of that. I'd set it up so the server deletes the result as soon as it's read once. If the response gets cut off in transit, the result is gone for good, and the next poll comes back with "no such job."

Now polling tolerates up to 15 consecutive failures, and reading a result no longer deletes it.

4. Same Phone, Different Behavior by OS

I had toolbars pinned to the top and bottom of the editor screen. When the on-screen keyboard popped up, those bars got covered.

On Android, it was an easy fix. One line of viewport config makes the browser shrink the actual viewport when the keyboard opens, so the pinned bars stay inside the smaller viewport, right where they should be.

iOS Safari ignores that setting. Safari leaves the layout size untouched and just shoves the whole page upward. From the webpage's point of view, nothing has changed — but the bottom of the screen is actually sitting under the keyboard.

So I started measuring the offset the page gets pushed up by and adding it to the pinned position manually. On anything other than Safari, that value is 0, so it has no effect.

When the keyboard opens Fix
Android Chrome Viewport shrinks One line of viewport config
iOS Safari Size unchanged, page is pushed up Measure the offset and compensate

What I learned here: the same problem can show up in a completely different shape on each platform.

5. I Got Caught by My Own Safeguard

In post #4, I built a placeholder mechanism: instead of letting the AI make up something it can't actually do, it writes down a placeholder, and publishing is blocked if even one is left.

Writing a post about that mechanism, I got stuck — because I needed to put an actual example of one in the text.

[[TASK: a one-line note on what's needed]]

The moment I put that in the body, the publish-blocker counted it as an unfilled placeholder. There was nothing to actually fill in, yet the post could never be published.

The fix was one line — don't count anything written inside a code block. Text inside code is an example, not an instruction.

The funny part is that this bug couldn't have surfaced until I actually wrote a post explaining the mechanism. If I'd only tested the feature itself, I'd never have found it.

6. The Common Thread

Laying all five out side by side, one thing overlapped.

How it went wrong
1 Error only in server logs, screen shows the old version
2 Saves fine, opens fine
3 Server's fine, only the client gives up
4 Nothing appears to change from the webpage's perspective
5 Blocking is the intended behavior, so it doesn't look like a bug

None of the five stopped. That's why they all took so long.

Since then, I've leaned toward making failures leave a visible state. If an AI draft fails, the post stays stuck at "draft requested," and the run log records why. Nothing passes through silently anymore.

The working-folder issue I wrote about in post #4 was the same kind of thing. The topic suggestions came out wrong, not erroring out. And because the result looked plausible, I noticed even later.


That's the story of how this blog got built. The admin kept getting patched even while I was writing these seven posts — item 5 is proof of that. Writing posts and building the tool ran side by side the whole time.