Skip to content

revert: restore guest session cookie storage - #67

Merged
CowboyGH merged 1 commit into
developfrom
revert/guest-session-cookie-storage
May 23, 2026
Merged

CowboyGH merged 1 commit into
developfrom
revert/guest-session-cookie-storage

Conversation

@CowboyGH

@CowboyGH CowboyGH commented May 23, 2026 •

Copy link
Copy Markdown
Owner

🚀 Summary

This PR reverts the removal of guest session cookie management that was introduced in #66. The GuestSessionStorage abstraction and its CookieJarGuestSessionStorage implementation are restored, along with the cookie_jar and dio_cookie_manager dependencies. The AuthSessionCubit is updated to clear guest cookies as part of the sign-in and guest-flow cancellation flows, ensuring that backend session state does not persist across guest-to-authenticated transitions.

Summary by CodeRabbit

  • New Features

    • Guest session cookies are now persisted locally for improved session stability.
    • Guest session cookies are automatically cleared when guest sessions end or users log out.
  • Tests

    • Updated test coverage for guest session cleanup scenarios.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 23, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d63ffdc8-9424-47ff-85a7-8ba705ad5cd3

📥 Commits

Reviewing files that changed from the base of the PR and between 4a318f3 and 5902bad.

⛔ Files ignored due to path filters (1)
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • lib/core/di/di.dart
  • lib/core/network/dio_setup.dart
  • lib/core/services/guest_session_storage/cookie_jar_guest_session_storage.dart
  • lib/core/services/guest_session_storage/guest_session_storage.dart
  • lib/features/auth/presentation/cubits/auth_session_cubit.dart
  • pubspec.yaml
  • test/features/auth/presentation/cubits/auth_session_cubit_test.dart

📝 Walkthrough

Walkthrough

This PR adds persistent guest session cookie support by introducing a GuestSessionStorage abstraction backed by CookieJar, wiring it through dependency injection, and integrating it into AuthSessionCubit to clear guest session cookies across all session management flows. The implementation adds cookie_jar and dio_cookie_manager dependencies, creates file-backed cookie persistence via PersistCookieJar in the DI setup, updates createDioClient to manage cookies via CookieManager, and refactors auth cleanup logic to clear both fitness-start progress and persisted session cookies concurrently.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • CowboyGH/moveUP-flutter#44: Overlaps in persistent guest cookie handling and AuthSessionCubit DI/cleanup wiring for guest session persistence.
  • CowboyGH/moveUP-flutter#66: Directly conflicts by removing the same GuestSessionStorage and cookie-management infrastructure introduced in this PR.
  • CowboyGH/moveUP-flutter#13: Both modify AuthSessionCubit; PR #13 introduces session restore/router logic while this PR extends it with guest session cookie persistence and cleanup.

Suggested labels

area: network, area: logic, type: refactor, breaking-change

Poem

🐰 A rabbit hops through cookies and jars,
Persisting guest sessions near and far,
The DI container weaves them tight,
AuthSessionCubit clears them right,
Cookie crumbles fade to the night!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'revert: restore guest session cookie storage' accurately describes the main change: restoring guest session cookie storage functionality that was previously removed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/guest-session-cookie-storage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CowboyGH CowboyGH self-assigned this May 23, 2026
@CowboyGH CowboyGH added area: network API, requests, and data parsing prio: high Critical priority - urgent action required area: logic State management and business logic breaking-change Changes that break current API or compatibility labels May 23, 2026
@CowboyGH
CowboyGH merged commit 6bc272a into develop May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: logic State management and business logic area: network API, requests, and data parsing breaking-change Changes that break current API or compatibility prio: high Critical priority - urgent action required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant