Repository navigation
fix: remove access token logging from examples - #230
volcano-staging[bot] wants to merge 2 commits into
Conversation
Volcano LavaFlow run 1fb6ec38-516e-4107-b72b-1e8da12581b4.
|
|
There was a problem hiding this comment.
LavaFlow is reviewing this draft at d669da6. Findings appear inline where the pull-request diff permits. See the run details for the complete review.
With the console.log lines gone, the three error-handling examples still run const { data } = await volcano.auth.getSession(); but never use data. The examples now fetch the session and throw it away, so they no longer show readers what "read the current state" or "treat the current session as authoritative" means. The code still works. Suggested change: Use the session without exposing tokens. For example, log data.session?.user?.id, or add a comment such as // update UI from data.session. Either way the destructured value does something and no token is printed."}]
After removing the two console.log('Current session:', data.session) lines and the 'Another auth operation established:' one, each branch still runs const { data } = await volcano.auth.getSession(); but never uses data. The example now shows a call whose result is discarded, which reads as dead code to someone copying it. Same cosmetic residue applies to the now-unused session variable in authentication/quickstart.md line 38, volcano-sdk.md line 319, and databases/quick-start.md line 51. Suggested change: Either drop the destructuring (await volcano.auth.getSession(); with a comment such as // Re-read the current session before deciding what to show) or use the result without printing the token, for example: const { data } = await volcano.auth.getSession(); if (!data.session) { /* redirect to login */ }
| @@ -138,12 +138,10 @@ if (AuthRefreshDiscardedError.is(error)) { | |||
| // Auth state changed while this request was pending. Read the current state | |||
| // or ask the user to retry; do not automatically replay a mutation. | |||
| const { data } = await volcano.auth.getSession(); | |||
There was a problem hiding this comment.
With the console.log lines gone, the three error-handling examples still run const { data } = await volcano.auth.getSession(); but never use data. The examples now fetch the session and throw it away, so they no longer show readers what "read the current state" or "treat the current session as authoritative" means. The code still works. Suggested change: Use the session without exposing tokens. For example, log data.session?.user?.id, or add a comment such as // update UI from data.session. Either way the destructured value does something and no token is printed."}]
| @@ -138,12 +138,10 @@ if (AuthRefreshDiscardedError.is(error)) { | |||
| // Auth state changed while this request was pending. Read the current state | |||
| // or ask the user to retry; do not automatically replay a mutation. | |||
| const { data } = await volcano.auth.getSession(); | |||
There was a problem hiding this comment.
After removing the two console.log('Current session:', data.session) lines and the 'Another auth operation established:' one, each branch still runs const { data } = await volcano.auth.getSession(); but never uses data. The example now shows a call whose result is discarded, which reads as dead code to someone copying it. Same cosmetic residue applies to the now-unused session variable in authentication/quickstart.md line 38, volcano-sdk.md line 319, and databases/quick-start.md line 51. Suggested change: Either drop the destructuring (await volcano.auth.getSession(); with a comment such as // Re-read the current session before deciding what to show) or use the result without printing the token, for example: const { data } = await volcano.auth.getSession(); if (!data.session) { /* redirect to login */ }
AI review: no P0-P2 findingsDocs-only change that removes ⚪ P3
🟣 Pre-existing
Not checked: The AI review read the diff, the code, and the PR's text; it ran no tests or builds and read nothing outside this repository. Human review: not needed |
| @@ -138,12 +138,10 @@ if (AuthRefreshDiscardedError.is(error)) { | |||
| // Auth state changed while this request was pending. Read the current state | |||
| // or ask the user to retry; do not automatically replay a mutation. | |||
| const { data } = await volcano.auth.getSession(); | |||
There was a problem hiding this comment.
⚪ P3: Error-handling examples now fetch the session and discard it
With the log lines removed, all three branches (lines 140, 144, 167) still run const { data } = await volcano.auth.getSession(); but never read data. The prose around them says to "read the current state" and "treat the current session as authoritative". The examples no longer show what that means, and a reader copying them gets an unused variable. Fix: use the session without printing tokens, for example if (!data.session) { /* redirect to sign-in */ } or log data.session?.user?.id. The same leftover appears in content/platform/authentication/quickstart.md:38, content/platform/authentication/volcano-sdk.md:319 and content/platform/databases/quick-start.md:51, where session is still destructured but unused.
Found by claude-opus-5-5
| @@ -46,7 +46,6 @@ if (error) { | |||
| } | |||
|
|
|||
| console.log('User created:', user.id); | |||
There was a problem hiding this comment.
🟣 Pre-existing: Sign-up examples read user.id although the SDK docs say sign-up returns no user
content/sdk/js/authentication.md:47 says signUp() without signInWhenAllowed: true returns no user and no session. Yet content/platform/authentication/quickstart.md:38-48 and content/platform/databases/quick-start.md:51-56 call signUp() without that option and then read user.id. A reader following either quickstart gets a TypeError on a null user. Line 51 of the auth quickstart also says the response "includes the user object and a session with tokens". This PR doesn't cause the problem (the removed session.access_token line would have thrown too), but these blocks are the ones it edits. Fix: pass signInWhenAllowed: true or add an explicit signIn step, and correct the response description.
Found by claude-opus-5-5
| @@ -138,12 +138,10 @@ if (AuthRefreshDiscardedError.is(error)) { | |||
| // Auth state changed while this request was pending. Read the current state | |||
| // or ask the user to retry; do not automatically replay a mutation. | |||
| const { data } = await volcano.auth.getSession(); | |||
There was a problem hiding this comment.
⚪ P3: Concurrency recovery examples discard the session they read
All three recovery branches now fetch data without using it, leaving the examples without a concrete step demonstrating the surrounding guidance to use the current session. Add an application-state update or an explanatory placeholder using data.session.
Found by gpt-6.1-sol
Volcano LavaFlow run 1fb6ec38-516e-4107-b72b-1e8da12581b4.
| @@ -46,7 +46,6 @@ if (error) { | |||
| } | |||
|
|
|||
| console.log('User created:', user.id); | |||
There was a problem hiding this comment.
🟣 Pre-existing: Signup examples assume the default response contains a user
content/sdk/js/authentication.md documents that signup returns no user or session by default. This example and content/platform/databases/quick-start.md:51–56 omit signInWhenAllowed yet read user.id, causing a TypeError after successful signup. Show a sign-in step before accessing the user and correct the response description. This inconsistency already exists in the base.
Found by gpt-6.1-sol
|
LavaFlow stopped: missing GitHub access. Check Volcano's GitHub App permissions and the project owner's push access. Review and merge or close this PR yourself. LavaFlow run |
Summary
docs(auth): remove access token logging from examples
Requested change. Implements the reporter's request.
Reviewer observations. LavaFlow's reviewers left 3 observations that don't hold this fix. Read them with
volcano cloud lavaflow show 1fb6ec38-516e-4107-b72b-1e8da12581b4 --json.Verification. Check the run details for recorded checks and this pull request for GitHub CI results. A test added or changed is not a claim that it passed.
An AI model wrote this change from a user's report and the repository's code at a pinned commit, not an observed runtime error. The repository's configured CI can run on this pull request. A person reviews and merges this change.
LavaFlow run
1fb6ec38-516e-4107-b72b-1e8da12581b4. Run details.