Skip to content

fix: out of context composable call#531

Open
fredericDelaporte wants to merge 1 commit into
atinux:mainfrom
fredericDelaporte:fix-useRequestFetch
Open

fix: out of context composable call#531
fredericDelaporte wants to merge 1 commit into
atinux:mainfrom
fredericDelaporte:fix-useRequestFetch

Conversation

@fredericDelaporte

@fredericDelaporte fredericDelaporte commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

fix #530

Summary by CodeRabbit

  • Refactor
    • Optimized session management request handling for improved efficiency

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d7b772-ac18-48eb-b6a8-12870a847700

📥 Commits

Reviewing files that changed from the base of the PR and between 76b49c4 and 7e13405.

📒 Files selected for processing (1)
  • src/runtime/app/composables/session.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/runtime/app/composables/session.ts

📝 Walkthrough

Walkthrough

In useUserSession, useRequestFetch() is now called once at composable initialization and stored in a local requestFetch variable. Both clear() and fetch() are updated to reuse this captured instance instead of invoking useRequestFetch() inline at call time.

Changes

Session composable call-context fix

Layer / File(s) Summary
Capture requestFetch at composable init
src/runtime/app/composables/session.ts
useRequestFetch() is called once at the top of useUserSession and stored in requestFetch. Both clear() (DELETE) and fetch() (GET) are updated to reference the captured value instead of invoking the composable inline at execution time.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 Hoppity hop, one call not two,
The fetch is captured, good as new.
No more composables out of place,
requestFetch stored with tidy grace.
The session clears without a fuss —
This little fix is big for us! ✨

🚥 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 accurately summarizes the main change: moving the composable call out of the execution context into the setup phase to fix the out-of-context call issue.
Linked Issues check ✅ Passed The code changes fully satisfy issue #530 by capturing useRequestFetch() during setup and reusing it in both clear() and fetch() functions, eliminating the context violation.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the composable context issue described in issue #530; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetch calls a composable while not being one itself

1 participant