Crypto Exchange Api Integration Lessons

Lessons from Integrating 5 Cryptocurrency Exchange APIs

Notes on the problems encountered while building a funding rate collection feature from multiple cryptocurrency exchanges in Ruby on Rails. Each of the 5 exchanges had different API behavior, and in some cases the official documentation didn’t match the actual behavior. Building a Common Base Client for Exchange APIs Before connecting multiple exchanges, I built a common HTTP client first. Used Faraday with retry and Circuit Breaker logic centralized here. ...

2025-12-06 · 7 min read · Seunghan
Api Response Wrapper Token Parsing Debug

Login Keeps Logging Out — Chain Bugs Caused by API Wrapper Format Mismatch

The mobile app keeps logging out. It works fine right after login, but when you background the app briefly and reopen it, the login screen appears. Token storage in SecureStorage was verified, and 401 auto-refresh via Dio interceptor was implemented. So why? Reproducing the Symptom Login to app -> works normally Restart app around access token expiration time -> Session restore fails, forced logout Found a hint in the server logs. ...

2025-12-02 · 5 min read · Seunghan
Hotwire Native Webview 8 Fixes

Hotwire Native WebView Debugging Collection — 8 Common Issues When Wrapping Rails WebView in Native Apps

When wrapping a Rails app with Hotwire Native (Turbo Native) to build iOS/Android native apps, there are quite a few things that work fine in the browser but behave strangely in WebView. Here are the issues encountered during actual development and the fixes applied, all in one place. Most can be resolved with a few lines of CSS or one line in the path configuration JSON. 1. Double-Tap Zoom / 300ms Click Delay Symptoms Double-tapping a button quickly zooms the screen. Even a single tap feels slightly delayed (about 300ms). ...

2025-11-25 · 5 min read · Seunghan
Spa Blank Screen Inertia Usepage Url Debugging

SPA Blank Screen After Deploy: Inertia.js usePage().url is a String

Rails + Inertia.js + Svelte 앱을 배포한 뒤 접속하면 완전히 빈 화면만 보였다. 서버는 정상이고 에셋도 다 로드되는데 화면이 안 그려지는 상황. 원인 추적부터 해결까지 정리한다. Symptoms 배포된 URL 접속 시 빈 화면 (흰색 배경만 표시) 로컬 개발 서버에서는 정상 동작 아무런 에러 페이지 없이 그냥 빈 화면 진단 과정 Step 1: HTTP 응답 확인 curl -s -o /dev/null -w "%{http_code}" https://example.com/ # 200 HTTP 200 OK. 서버 자체는 정상 응답 중이다. ...

2025-11-22 · 3 min read · Seunghan
Rails Stimulus Controllers Lookbook Debug

Rails + Stimulus: Implementing 11 Controllers — Scroll, Carousel, Text Animation

Rails + ViewComponent + Lookbook 조합으로 컴포넌트 라이브러리를 만들 때, Stimulus 컨트롤러가 전부 스텁(빈 껍데기) 상태로 남아있는 상황을 맞닥뜨렸다. 13개 컨트롤러 중 3개만 동작하고 나머지 10개는 connect() {} 한 줄짜리였다. 이걸 전부 구현하면서 겪은 삽질을 정리한다. 구현 대상 총 11개 컨트롤러를 4단계로 나눠서 구현했다. Wave 컨트롤러 핵심 기술 1 TagInput, FileDropzone, CategoryTab DOM 조작, 드래그 이벤트 2 ScrollReveal, ScrollScale, VideoScrubbing, HorizontalScroll RAF 쓰로틀, IntersectionObserver, ResizeObserver 3 ScrambleText, RandomReveal RAF 애니메이션 루프, Fisher-Yates 셔플 4 ImageCarousel, CarouselContainer 드래그/터치, translateX 트랜지션 삽질 1: Lookbook 프리뷰에서 Stimulus가 아예 안 됨 가장 크게 막혔던 부분이다. 컨트롤러를 다 구현하고 Lookbook을 열었는데 아무 동작도 하지 않는다. 크롬 DevTools를 열어보니 data-controller 속성은 붙어있는데 Stimulus가 연결이 안 된 상태였다. ...

2025-11-18 · 6 min read · Seunghan
Rails Inertia Svelte Pet Avatar Image Color

Rails + Inertia + Svelte 5: Avatar Image/Color Selection Feature Implementation Struggles

This documents the problems encountered while implementing a pet profile avatar selection feature (image or color) on a Rails 8 + Inertia.js + Svelte 5 stack. Problem 1: Colors Were Not Stored in the DB Symptoms Looking at the initial code, pet card colors were displayed like this: const PET_COLORS = ['#f3caa1', '#b7ddf9', '#d3c8ff', '#c5d5f4', '#ffd9aa'] function petColor(index: number): string { return PET_COLORS[index % PET_COLORS.length] } Colors were determined by the order (index) in which pets were created. Since colors were not stored in the DB at all, even if a user changed a color, it would revert to the original on refresh. ...

2025-11-15 · 4 min read · Seunghan
Apple Sso 403 Email Verified Type Mismatch

Apple Sign-In 403 Error: email_verified Type Mismatch and 3 Copy-Paste Bugs

Apple Sign-In was failing with 403 Forbidden while Google Sign-In worked perfectly fine. Since Apple login worked correctly in another project using the same stack (Rails 8 + Flutter), I did a comparative analysis. Symptoms Apple login: 403 Forbidden Google login: works fine Error message: "Email not verified by Apple" Cause 1: email_verified Type Mismatch (Core Issue) Apple and Google return the email_verified field in JWT with different types. Provider email_verified type Example value Google boolean true Apple string or boolean "true" or true The problematic code: ...

2025-10-25 · 3 min read · Seunghan
Rails Missing Migration Sessions Table

Production DB Missing Table: schema.rb and Migration File Mismatch Incident

I received a report that sign-up and login were completely broken. The app just repeated “An unexpected error occurred.” Symptoms Sign-up attempt -> 500 Internal Server Error Login attempt -> same 500 Health check API -> 200 OK, DB connection normal The server was alive and DB was connected, but all authentication features were dead. Investigation Process Step 1: Check Server Status SSH in and check the Rails environment. rails runner "puts Rails.env" # => production rails runner "puts User.count" # => 13 Server normal, DB connection normal, user data exists. ...

2025-10-18 · 5 min read · Seunghan
Rails Flutter Server Health Check 4 Issues

Rails + Flutter App Server Health Check: 4 Issues Found and Fixed at Once

After uploading a test build of the app and running it myself, 4 things broke simultaneously. Google login failure, AI itinerary generation returning wrong results, app crash on tapping the notification button, and the popular destinations section completely empty. Here is the process of finding and fixing each cause. 1. Google SSO Fails While Apple Login Succeeds Symptoms Apple Sign-In works normally but Google Sign-In returns a 500 error. The client only shows a login failure toast. ...

2025-10-15 · 6 min read · Seunghan
Flutter Rails Auth Session Persistence Debugging

Flutter + Rails Auth Session Keeps Dropping - 3 Causes and Solutions

Login sessions keep dropping in a Flutter BLoC app. Tokens are stored in SecureStorage, automatic renewal on 401 is implemented via Dio interceptors – so why? Starting from server logs, I found 3 causes and fixed all of them. Here is the full process. Tech Stack Mobile: Flutter + BLoC pattern + Dio HTTP + SecureStorage Server: Rails 8 API + ActionCable WebSocket Auth: SHA-256 digest-based access token + JTI refresh token (90 days) Real-time: ActionCable WebSocket (token-based auth) Symptoms Works fine right after login API requests start failing with 401 after some time Token refresh seems to work, but WebSocket disconnects App eventually transitions to unauthenticated state Cause 1: Ghost of Legacy Code - Residual DTA Methods Discovery Server logs showed intermittent user.tokens-related errors during token refresh. The project had migrated from devise_token_auth (DTA) to a custom token system, but token_refresh_service.rb still had DTA-era code. ...

2025-09-27 · 5 min read · Seunghan
Privacy Policy Terms Disclaimer Contact