Chrome Extension Debugging Lessons — Domain Whitelist, Duplicate Listeners, Closure Pitfalls

When maintaining a Chrome extension, “this should definitely work, why doesn’t it?” comes up more often than expected. I made four consecutive mistakes in a short period, each with a different root cause. Writing them down. 1. A return in the dispatch block silently kills generic detection Content scripts typically end with a pattern like this: if (isSomeSpecificPage()) { doSomethingSpecific(); return; // ← exits here } // Generic DOM detection (MutationObserver, etc.) const observer = new MutationObserver(() => { ... }); observer.observe(document.body, { childList: true, subtree: true }); After adding a feature for a specific domain with an early return, the generic DOM detection never ran in a popup window on that domain. ...

2026-03-09 · 5 min read · Seunghan

Flutter BottomSheet Overlapping Navigation Bar: Switching to showDialog

Using showModalBottomSheet for form input screens feels natural. But when your app has a bottom navigation bar, the sheet slides up and covers the navigation — it works functionally, but looks cluttered. Three issues were fixed in one go: Bottom sheet → centered modal conversion TextButton cancel button rendering in yellow (unreadable) PlatformException when sharing a SQLite file with share_plus Problem 1: BottomSheet Covers the Navigation Bar Symptom An input form built with showModalBottomSheet overlaps the bottom navigation bar when it slides up. Even with isScrollControlled: true, the sheet extends over the navigation area. ...

2026-03-09 · 4 min read · Seunghan
Render Multi Service Error Fix Deploy

Render 6 Service Error Bulk Fix — Stoplight, FK Constraints, Puma 7, Solid Stack Debugging

Render에 올려둔 Rails 서비스 6개가 전부 각자 다른 에러를 토해내고 있었다. 하나씩 로그를 까보니 공통 패턴도 있고, 프로젝트마다 고유한 문제도 있었다. 한 세션에서 전부 수정하고 배포까지 마친 과정을 정리한다. 전체 상황 Render API로 서비스 6개의 로그를 일괄 조회했다. 결과: 서비스 주요 에러 서비스 A ERB 문법 에러로 500 (이미 커밋됐지만 미배포) 서비스 B Stoplight Light#run 블록 에러 + Telegram 파싱 에러 서비스 C solid_cache_entries 테이블 누락 서비스 D PG::UndefinedColumn + solid_cache 누락 서비스 E PG::DuplicateTable sessions + Sentry 초기화 에러 서비스 F TaskCleanupJob FK 위반 + Puma deprecated 경고 공통 패턴: Rails 8의 Solid Stack (SolidCache, SolidQueue, SolidCable) 초기 설정 문제가 여러 프로젝트에서 반복됐다. ...

2026-02-24 · 6 min read · Seunghan
Rails Sso Turbo Drive Debugging

Two Bugs Caused by Turbo Drive During Rails SSO Implementation

Rails 앱 간 SSO(Single Sign-On)를 HMAC 기반으로 구현하던 중 예상치 못한 두 가지 버그를 만났다. 둘 다 Turbo Drive와 ERB의 동작 방식에서 비롯된 문제였다. 구현 개요 Structure IdP (Identity Provider): 사용자 인증을 담당하는 Rails 앱 (OTP 로그인) SP (Service Provider): IdP에서 인증받아 로그인하는 Rails 앱 플로우 SP 로그인 버튼 클릭 → SP: state 생성 후 세션 저장, IdP /authorize로 리다이렉트 → IdP: 로그인 확인 후 One-Time Token 발급 → IdP: authorize_complete 페이지 표시 (2초 후 SP callback으로 자동 리다이렉트) → SP callback: state 검증 + token 검증 → 로그인 완료 핵심 보안 요소 CSRF 방지: SP에서 생성한 state를 세션에 저장하고 callback에서 검증 HMAC 서명: SP가 IdP의 /verify 엔드포인트에 서명된 요청으로 token 검증 One-Time Token: 한 번 사용하면 무효화되는 토큰 버그 1: “state mismatch” — Turbo Drive prefetch가 세션을 덮어쓴다 Symptoms SP의 “SSO 로그인” 버튼을 클릭하면 IdP에서 인증 완료 페이지까지 잘 가는데, SP callback에서 항상 state mismatch 에러가 발생했다. ...

2026-02-13 · 4 min read · Seunghan
Rails Rfc3161 Tsa Blockchain Merkle Debugging

RFC 3161 TSA Timestamp + Blockchain Merkle Anchoring: Debugging in Rails

전자계약 보관 시스템에 법적 증거력을 부여하기 위해 두 가지를 동시에 구현해야 했다: 블록체인 Merkle Tree 앵커링 — 계약 해시들을 모아 Merkle Root를 L2 체인에 기록 RFC 3161 TSA 타임스탬프 — 신뢰할 수 있는 제3자 시간 증명 간단해 보였는데, 삽질의 연속이었다. 1. RFC 3161 TSA란? RFC 3161은 Time-Stamp Authority(TSA) 프로토콜로, 특정 데이터가 특정 시점에 존재했음을 제3자가 증명해주는 표준이다. 흐름은 간단하다: 클라이언트 → SHA-256 해시 생성 → TSA 서버에 요청 → 서명된 타임스탬프 토큰 수신 무료 TSA 서버들: ...

2026-02-06 · 4 min read · Seunghan
Rails Project Health Check 553 Tests

Rails Project Deep Inspection — From 16 Tests to 553, Finding 8 Hidden Bugs

운영 중인 Rails 8 API 서버를 점검하기로 했다. 기능은 대부분 동작하고 있었지만, 테스트 커버리지가 3%밖에 안 되는 상태. “동작하니까 괜찮겠지"라는 생각이 얼마나 위험한지 확인하는 과정이었다. 점검 전 상태 Rails 8 + PostgreSQL (UUID PK) + JWT 인증 + Pundit 권한 RSpec 테스트: 16개 (기본 scaffold 수준) 모델 20개+, 컨트롤러 15개+, 서비스 5개+ Dockerfile은 배포용으로 작성되어 있었고, CI는 없음 발견된 문제들 1. Dockerfile Ruby 버전 불일치 # Dockerfile FROM ruby:3.2-slim AS builder # ← 여기가 3.2 # Gemfile.lock RUBY VERSION ruby 3.4.4p34 # ← 실제는 3.4 로컬에서는 rbenv로 3.4를 쓰고 있어서 문제 없었지만, Docker 빌드 시 gem 호환성 에러가 날 수 있는 시한폭탄이었다. ...

2026-02-03 · 4 min read · Seunghan
Chrome Extension Oacx Iframe Korean Ime Fix

Chrome Extension iframe OACX Auto-Fill Not Working — Timing and Korean IME Issues

I built a Chrome extension that auto-fills the OACX (simplified authentication) form on Korean government sites. It worked on most sites, but got feedback saying “the name field isn’t being filled” on a specific major site. Symptoms Extension auto-fills name, birthdate, and phone number when the simplified auth popup opens Works correctly on most government sites (Gov24, National Health Insurance, etc.) Only on a specific site, the name field was empty – birthdate and phone number also weren’t filled Investigation: Checking Actual DOM Structure with Playwright Opened the page reported by the user directly using Playwright MCP. ...

2026-01-23 · 5 min read · Seunghan
Calendar Print Browser Print Bug Paper Sizes

The Trap of Web Calendar Printing: window.print() Ignores Off-Screen Elements

I built a calendar printing feature for the web. PDF and PNG downloads worked perfectly, but when hitting the browser print button, image positions weren’t reflected at all. Same data, so why different results? Structure: Preview and Hidden Export Target The calendar print page had this structure: +-- Visible Area ----------------------------+ | [Settings Panel] [Preview Area] | | - Date range Calendar preview | | - Theme/Color | | - Image position slider | +--------------------------------------------+ +-- Hidden Export Target --------------------+ | <div class="fixed -left-[9999px]"> | <- off-screen | <PrintableCalendar ... /> | | </div> | +--------------------------------------------+ The preview is a scaled-down thumbnail, while the actual export calendar is rendered at full size off-screen (-left-[9999px]). PDF/PNG capture this hidden element. ...

2026-01-20 · 4 min read · Seunghan
Rails Turbo Actioncable 500 Debug

Rails Turbo Stream 500 Error Triple Debugging — broadcast, SolidCable, Telegram Markdown

Rails 8 + Hotwire(Turbo) 기반 앱을 운영하다 보면 broadcast_append_to 계열 콜백이 조용히 500을 내뱉는 경우가 있다. 거기에 SolidCable 초기 설정 문제와 Telegram Bot 메시지 파싱 오류가 겹치면 로그 해석도 헷갈린다. 이번에 세 가지가 한꺼번에 터져서 순서대로 해결한 과정을 정리한다. Problem 1: No unique index found for id — broadcast 콜백 500 현상 메시지나 알림을 생성할 때 컨트롤러에서 500이 발생한다. 로그를 보면: MessagesController#create error: No unique index found for id Cause Rails after_create_commit 콜백 안에서 broadcast_append_to 를 호출할 때, 내부적으로 ActionCable 채널을 통해 메시지를 전달하는 과정에서 예외가 발생한다. SolidCable을 쓰는 경우 특히 초기 설정이 완전하지 않으면 이 에러가 자주 나온다. ...

2026-01-09 · 4 min read · Seunghan
Rails Ruby3 Kwargs Dispatch Integration Debug

A Day of Debugging — Ruby 3.0 kwargs, Docker env, NAS Cron, SSH Special Characters

AI 에이전트가 Rails API 서버를 호출해서 티켓을 자동 배정하는 디스패처를 만들었다. 로직 자체는 간단한데 붙이는 과정에서 예상치 못한 곳에서 계속 막혔다. 겪은 것들을 기록해 둔다. 1. Ruby 3.0 kwargs 분리 — render_success(key: val) 가 왜 터지나 가장 오래 고생한 것. Rails 컨트롤러에서 응답 헬퍼를 이렇게 호출했다: render_success(tickets: tickets_list, pagination: pagination_data) 서버 로그에 찍힌 에러: ArgumentError - unknown keywords: :tickets, :pagination 헬퍼 정의는 이렇다: def render_success(data, status: :ok) render json: { success: true, data: data }, status: status end Ruby 2.x에서는 render_success(tickets: ..., pagination: ...) 호출 시 {tickets: ..., pagination: ...} 해시가 data에 들어갔다. ...

2026-01-02 · 5 min read · Seunghan
Privacy Policy Terms Disclaimer Contact