Repository navigation
v1.1.8 - Session Persistence Fixed!
π Session Persistence FINALLY Working!
This release fixes session persistence by upgrading to InstantDB v0.3.3, which corrects a critical API endpoint bug that affected all previous v0.3.x releases.
Changed
- β¬οΈ Upgraded InstantDB from v0.2.9 to v0.3.3: Session persistence FINALLY working!
- π macOS development workflow fixed: No code signing required for debug builds!
- π Session persistence NOW WORKS: v0.3.3 fixes critical API endpoint bug
- β¨ Updated to new
SessionStorageType.autoAPI (replacesenableSessionPersistence) - π§ Debug builds use SharedPreferences (no macOS keychain entitlements needed)
- π Release builds use SecureStorage when available, else SharedPreferences
- Impact: Sessions now persist automatically across app restarts (hot restart & cold restart)
Technical Details
Root Cause Discovered: Versions v0.3.0-v0.3.2 had a critical bug where session restoration used the wrong API endpoint:
- Wrong:
GET /v1/auth/mewith refresh token as Bearer header (designed for user info, not session restoration) - Correct:
POST /runtime/auth/verify_refresh_tokenwith refresh token in request body (matches React SDK)
Version Journey:
- v0.3.0: Introduced build-mode aware storage, but used wrong restoration endpoint
- v0.3.1: Fixed backward compatibility logic, but still used wrong endpoint
- v0.3.2: Fixed type cast validation, but still used wrong endpoint
- v0.3.3: Finally uses correct endpoint! Session restoration now works properly β¨
The 36-character refresh token UUID was always correct - it was just being sent to an endpoint that didn't know how to handle it.
Files Updated
pubspec.yaml: instantdb_flutter v0.2.9 β v0.3.3lib/src/services/database_service.dart: Changed to sessionStorageType: SessionStorageType.autoexample/macos/Runner/DebugProfile.entitlements: Reverted keychain entitlements (no longer needed for debug)example/macos/Runner/Release.entitlements: Reverted keychain entitlements (no longer needed for debug)
Full Changelog: v1.1.6...v1.1.8