Mcp Flutter Rails System Category Debug

From MCP Tool Integration to Flutter Settings Toggle — Debugging Record

I created categories on the server side using MCP tools. But the new categories were not visible in the mobile app. It seemed like a simple problem, but the deeper I dug, the more layers were tangled together. The Beginning: Categories Created via MCP Not Showing in App I created system categories like dev/, memory on the server through MCP tools. Calling the API directly showed the data. Refreshing the app did not show them. ...

2025-12-13 · 5 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
Flutter Store Beta Mode Purchase Logic

Flutter IAP Store Beta Mode Design and Purchase Logic Hardening

When implementing IAP (In-App Purchase) in a Flutter app and running an open beta, gaps like “it is beta but the store shows paid prices” or “credits are duplicated on Restore” start to surface. Here are the issues I encountered and how they were resolved. 1. The Contradiction Between Beta Mode and the Store Problem // constants.dart static const bool isOpenBeta = true; When isOpenBeta = true, spendCredits() does not deduct credits. This means AI features are free. ...

2025-11-08 · 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
Flutter Bloc Infinite Scroll Pagination

Flutter BLoC Infinite Scroll Implementation — Layer-by-Layer Design Without External Packages

Loading the entire list upfront is slow. I needed infinite scroll that naturally loads the next batch of data as the user scrolls. Packages like infinite_scroll_pagination exist, but fitting them into an existing BLoC structure sometimes means redesigning your state to match the package’s approach, which can actually make things more complex. Since it’s perfectly achievable with just ScrollController and no external dependencies, I went that route. Why Offset-Based There are two pagination approaches. ...

2025-09-20 · 6 min read · Seunghan
Flutter Bloc Complex State Management

Flutter BLoC - Designing State Management for Complex Q&A Sessions

A BLoC that just loads and displays a list isn’t hard. The challenge comes when you need to manage session-based workflows in a single BLoC – things like “create a session -> add questions -> receive answers -> complete.” Draw the States First Before coding the BLoC, define the states first. Listing all the states the UI needs to display for this workflow: Initial (nothing loaded) Session list loading Session list displayed Creating new session Session detail loading Session detail displayed (with question list) Adding question Submitting answer Error abstract class ReviewQaState {} class ReviewQaInitial extends ReviewQaState {} class ReviewQaLoading extends ReviewQaState {} class ReviewQaSessionListLoaded extends ReviewQaState { final List<QaSession> sessions; ReviewQaSessionListLoaded(this.sessions); } class ReviewQaSessionLoaded extends ReviewQaState { final QaSession session; final List<ReviewQuestion> questions; ReviewQaSessionLoaded({required this.session, required this.questions}); } class ReviewQaQuestionAdded extends ReviewQaState { final ReviewQuestion question; ReviewQaQuestionAdded(this.question); } class ReviewQaError extends ReviewQaState { final String message; ReviewQaError(this.message); } State classes need to be this specific so the UI can branch clearly with if (state is ReviewQaSessionLoaded). ...

2025-07-06 · 4 min read · Seunghan
Privacy Policy Terms Disclaimer Contact