Skip to content

Ask for an alias on login when the email is not found#6935

Merged
gonzaloriestra merged 2 commits intomainfrom
ask-for-alias-on-login
Mar 26, 2026
Merged

Ask for an alias on login when the email is not found#6935
gonzaloriestra merged 2 commits intomainfrom
ask-for-alias-on-login

Conversation

@gonzaloriestra
Copy link
Copy Markdown
Contributor

@gonzaloriestra gonzaloriestra commented Mar 4, 2026

WHY are these changes introduced?

Apparently, sometimes the sessions are stored with the UUID (the fallback) instead of the email, or overwritten after some time (when refreshing).

See discussion in #6933

WHAT is this pull request doing?

  • Avoid overwriting the session alias on refresh, but only when running shopify auth login
  • If the email can't be fetched, ask for a manual alias instead of using the UUID:
04-50-022h2-44gy1

How to test your changes?

shopify auth login

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@gonzaloriestra
Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.22% 14940/18170
🟡 Branches 74.66% 7400/9911
🟢 Functions 81.36% 3768/4631
🟢 Lines 82.62% 14125/17097

Test suite run success

3917 tests passing in 1503 suites.

Report generated by 🧪jest coverage report action from 81f2cc6

@gonzaloriestra gonzaloriestra force-pushed the ask-for-alias-on-login branch from c5fa758 to 72659f1 Compare March 4, 2026 11:16
@gonzaloriestra gonzaloriestra force-pushed the ask-for-alias-on-login branch 2 times, most recently from 072b6e7 to c81eb49 Compare March 5, 2026 11:31
@gonzaloriestra
Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

This comment was marked as outdated.

@gonzaloriestra gonzaloriestra force-pushed the ask-for-alias-on-login branch 2 times, most recently from 00f8bfe to 38eade8 Compare March 12, 2026 11:38
@gonzaloriestra gonzaloriestra marked this pull request as ready for review March 13, 2026 13:27
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner March 13, 2026 13:27
@github-actions
Copy link
Copy Markdown
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@gonzaloriestra gonzaloriestra force-pushed the ask-for-alias-on-login branch from 38eade8 to 81f2cc6 Compare March 19, 2026 12:09
Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/private/node/session/store.d.ts
@@ -21,6 +21,13 @@ export declare function remove(): Promise<void>;
  * @returns The alias for the session if it exists, otherwise undefined.
  */
 export declare function getSessionAlias(userId: string): Promise<string | undefined>;
+/**
+ * Sets the alias for a given user's session and persists it.
+ *
+ * @param userId - The user ID of the session to update.
+ * @param alias - The new alias to set.
+ */
+export declare function setSessionAlias(userId: string, alias: string): Promise<void>;
 /**
  * Finds a session by its alias.
  *

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260319121057

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Copy link
Copy Markdown
Contributor

@alfonso-noriega alfonso-noriega left a comment

Choose a reason for hiding this comment

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


Review assisted by pair-review

Comment thread packages/cli-kit/src/private/node/session.ts
Comment thread packages/cli-kit/src/private/node/session.ts
Comment thread packages/cli-kit/src/public/node/session-prompt.ts
Copy link
Copy Markdown
Contributor Author

gonzaloriestra commented Mar 26, 2026

Merge activity

  • Mar 26, 12:04 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 26, 12:04 PM UTC: @gonzaloriestra added this pull request to the GitHub merge queue with Graphite.

@gonzaloriestra gonzaloriestra added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 56d3ba3 Mar 26, 2026
30 checks passed
@gonzaloriestra gonzaloriestra deleted the ask-for-alias-on-login branch March 26, 2026 12:10
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.

2 participants