[PR #3985] [CLOSED] fix(cli): create telemetry object before doing CLI tasks #22021

Closed
opened 2026-04-15 20:45:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3985
Author: @frectonz
Created: 8/13/2025
Status: Closed

Base: canaryHead: fix/telemetry-notice-in-cli


📝 Commits (10+)

  • 747da69 fix(cli): create telemetry object before doing CLI tasks
  • 059eb97 Merge branch 'canary' into fix/telemetry-notice-in-cli
  • d5aca08 fix(cli): create telemetry object before doing CLI tasks in migrate
  • 0a4dd66 fix(cli): remove console log
  • 3f3ce17 fix(cli+telemetry): make sure telemetry doesn't get run twice for CLI commands
  • b4efa34 fix(telemetry): make no op publish have the same type signature as the real publish function
  • edf43fe Merge branch 'canary' into fix/telemetry-notice-in-cli
  • 09834e8 Merge branch 'canary' into fix/telemetry-notice-in-cli
  • 4cebc8d Merge branch 'canary' into fix/telemetry-notice-in-cli
  • 06bb1fb Merge branch 'canary' into fix/telemetry-notice-in-cli

📊 Changes

3 files changed (+25 additions, -11 deletions)

View changed files

📝 packages/better-auth/src/telemetry/index.ts (+8 -0)
📝 packages/cli/src/commands/generate.ts (+9 -5)
📝 packages/cli/src/commands/migrate.ts (+8 -6)

📄 Description

This PR addresses two issues.

Firstly, it ensures that the telemetry notice is displayed before any CLI prompts are initiated.

Secondly, it resolves the issue of the telemetry notice being printed twice. This occurs because loading the configuration triggers the init function, which in turn triggers the creation of the telemetry object, which subsequently prints the telemetry notice. The PR introduces some logic to prevent the creation of the telemetry object during the configuration loading process in the CLI.

Summary by cubic

Moved telemetry object creation to the start of the CLI generate command to avoid repeated initialization and possible errors.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/3985 **Author:** [@frectonz](https://github.com/frectonz) **Created:** 8/13/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/telemetry-notice-in-cli` --- ### 📝 Commits (10+) - [`747da69`](https://github.com/better-auth/better-auth/commit/747da6976421664eb66ec1a40dd396095033833f) fix(cli): create telemetry object before doing CLI tasks - [`059eb97`](https://github.com/better-auth/better-auth/commit/059eb97400e004f3e1b0ef8dc85e0f46b4522f6e) Merge branch 'canary' into fix/telemetry-notice-in-cli - [`d5aca08`](https://github.com/better-auth/better-auth/commit/d5aca086b3b362c4f71611283fd6c95132eac467) fix(cli): create telemetry object before doing CLI tasks in migrate - [`0a4dd66`](https://github.com/better-auth/better-auth/commit/0a4dd66a2dd2799fd6efc9d0cf2dd7105d14e5af) fix(cli): remove console log - [`3f3ce17`](https://github.com/better-auth/better-auth/commit/3f3ce176d8aa00bd4a7c6fa535c380634569aad7) fix(cli+telemetry): make sure telemetry doesn't get run twice for CLI commands - [`b4efa34`](https://github.com/better-auth/better-auth/commit/b4efa3477136ff434ed351d488464b4acd546316) fix(telemetry): make no op publish have the same type signature as the real publish function - [`edf43fe`](https://github.com/better-auth/better-auth/commit/edf43fed9729907b19d73d79572df9611e76a2d1) Merge branch 'canary' into fix/telemetry-notice-in-cli - [`09834e8`](https://github.com/better-auth/better-auth/commit/09834e82e31cd34715631354cd28850fd1adc24d) Merge branch 'canary' into fix/telemetry-notice-in-cli - [`4cebc8d`](https://github.com/better-auth/better-auth/commit/4cebc8dbfe477d3597be56bccfd50a9d2aa6c505) Merge branch 'canary' into fix/telemetry-notice-in-cli - [`06bb1fb`](https://github.com/better-auth/better-auth/commit/06bb1fb98829e13354bd212a0d99b2e8904912ba) Merge branch 'canary' into fix/telemetry-notice-in-cli ### 📊 Changes **3 files changed** (+25 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/telemetry/index.ts` (+8 -0) 📝 `packages/cli/src/commands/generate.ts` (+9 -5) 📝 `packages/cli/src/commands/migrate.ts` (+8 -6) </details> ### 📄 Description This PR addresses two issues. Firstly, it ensures that the telemetry notice is displayed before any CLI prompts are initiated. Secondly, it resolves the issue of the telemetry notice being printed twice. This occurs because loading the configuration triggers the init function, which in turn triggers the creation of the telemetry object, which subsequently prints the telemetry notice. The PR introduces some logic to prevent the creation of the telemetry object during the configuration loading process in the CLI. <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Moved telemetry object creation to the start of the CLI generate command to avoid repeated initialization and possible errors. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 20:45:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#22021