-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: limit proxy session warning to once per client instance #900
Conversation
I believe you are just updating the local variable here, which won't be picked up on next invocations. |
Perhaps I got it wrong, but it passes the addition to the test. That This is only a per-request "fix". |
References only work for objects in javascript, It's passing the test because you're using the value of |
Ah thank you! I'll have to play with it a bit more then. So, if I understand you, this is only a partial fix: it works only when you re-access session.user, but if you were to call getSession again, then it would log again. |
yup that's because a new proxy is created everytime |
Thanks @kangmingtay and @Zanzofily. I've made a couple of tweaks that I believe resolves the issue with subsequent proxy instance creations. @kangmingtay, I'm not sure if the team approves of me expanding an existing test. I can separate if needed. |
@j4w8n that's fine, thanks for helping with this! |
🤖 I have created a release *beep* *boop* --- ## [2.64.3](v2.64.2...v2.64.3) (2024-06-17) ### Bug Fixes * don't call removeSession prematurely ([#915](#915)) ([e0dc518](e0dc518)) * limit proxy session warning to once per client instance ([#900](#900)) ([4ecfdda](4ecfdda)) * patch release workflow ([#922](#922)) ([f84fb50](f84fb50)) * type errors in verifyOtp ([#918](#918)) ([dcd0b9b](dcd0b9b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
What kind of change does this PR introduce?
Bug fix.
What is the current behavior?
A call to
getSession()
, when using server storage, logs a warning every timesession.user
is accessed. This is causing a lot of people to see multiple consecutive logs to the console - especially for SvelteKit users.What is the new behavior?
Ensures that accessing
session.user
, from agetSession()
call, only logs the warning once per Proxy session instance. In other words, once per server request.Additional context
#888