Skip to content

fix: remove access token logging from examples - #230

Open
volcano-staging[bot] wants to merge 2 commits into
mainfrom
volcano/lavaflow/1fb6ec38-516e-4107-b72b-1e8da12581b4
Open

volcano-staging[bot] wants to merge 2 commits into
mainfrom
volcano/lavaflow/1fb6ec38-516e-4107-b72b-1e8da12581b4

Conversation

@volcano-staging

@volcano-staging volcano-staging Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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.

Volcano LavaFlow run 1fb6ec38-516e-4107-b72b-1e8da12581b4.
@volcano-staging volcano-staging Bot added the Volcano LavaFlow Opened by Volcano LavaFlow label Nov 19, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@volcano-staging volcano-staging Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 */ }

@volcano-staging
volcano-staging Bot marked this pull request as ready for review November 19, 2026 03:04
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review: no P0-P2 findings

Reviewed 3fdd6e2. Run log

Docs-only change that removes console.log lines printing access tokens or whole session objects from JavaScript examples in four pages (auth quickstart, auth SDK reference, database quick start, JS SDK error handling). This head has the same net diff as the previously reviewed one. Risk is low. The only issue the PR adds is cosmetic: some examples now fetch values they never use. No other access-token logging remains in the docs.

⚪ P3

  • content/sdk/js/error-handling.md:140 Error-handling examples now fetch the session and discard it

🟣 Pre-existing

  • content/platform/authentication/quickstart.md:48 Sign-up examples read user.id although the SDK docs say sign-up returns no user (also reported as: Signup examples assume the default response contains a user)

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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟣 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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟣 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

@volcano-staging

Copy link
Copy Markdown
Contributor Author

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 1fb6ec38-516e-4107-b72b-1e8da12581b4.

This branch has not been deployed

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

Labels

Volcano LavaFlow Opened by Volcano LavaFlow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant