Flutter Sync Queue Aggressive Error Handling

Fixing Unnecessary Error Exposure in Flutter Sync Queue

While implementing a Transactional Outbox pattern for offline sync in a mobile app, I discovered that “sync failed” errors were repeatedly shown to users even though synchronization had actually completed successfully. Symptoms The app repeatedly threw the following error: AppException: Failed to push changes: AppException: Push completed with failures; retry count: 2, pending changes remain in queue. Checking server logs confirmed that sync pull was working normally and the data was already synchronized. ...

2025-10-04 · 5 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
Telegram Bot Intent Classification Bugs

3 Telegram Bot Intent Classification Bugs and Inline Keyboard Confirmation Flow

Telegram 봇에 자연어로 할 일을 추가하는 기능을 운영하던 중 발생한 버그 3가지와, 사용자 경험 개선을 위한 inline keyboard 확인 플로우 구현 내용을 정리한다. 버그 1: “저녁9시” → 09:00(AM)으로 파싱되는 문제 현상 입력: "내일 저녁 커피챗 미팅 저녁9시일정추가" 기대: due_time = "21:00" 실제: due_time = "09:00" Cause extract_time_from_text 메서드에서 패턴 체크 순서가 잘못되어 있었다. # 버그 코드 if match = text.match(/오후\s*(\d{1,2})시/) # 1) 오후 ... end if match = text.match(/오전\s*(\d{1,2})시/) # 2) 오전 ... end if match = text.match(/(\d{1,2})시\s*(\d{1,2})?분?/) # 3) 숫자시 ← 여기서 "9시" 매칭 hour = match[1].to_i # 9 → "09:00" 반환, 아래 case/when은 도달 불가 return "#{hour.to_s.rjust(2, '0')}:00" end case text when /저녁/ return "18:00" # ← 절대 도달 못 함 end “저녁9시"에서 오후, 오전 패턴은 불일치하지만 세 번째 /(\d{1,2})시/ 패턴이 9시를 잡아 09:00을 반환해버린다. 그 아래 case when /저녁/은 절대 실행되지 않는다. ...

2025-06-25 · 5 min read · Seunghan
Privacy Policy Terms Disclaimer Contact