Skip to content

v1.1.8 - Session Persistence Fixed!

Choose a tag to compare

@pillowsoft pillowsoft released this 03 Jan 03:47
· 12 commits to main since this release

πŸŽ‰ 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.auto API (replaces enableSessionPersistence)
    • πŸ”§ 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/me with refresh token as Bearer header (designed for user info, not session restoration)
  • Correct: POST /runtime/auth/verify_refresh_token with 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.3
  • lib/src/services/database_service.dart: Changed to sessionStorageType: SessionStorageType.auto
  • example/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