rtk-ai/rtk

bug(telemetry): salt file not auto-created on macOS — device hash shows '(no salt file)'

Open

#1,656 创建于 2026年5月1日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Rust (48,085 star) (2,914 fork)batch import
bugeffort-smallgood first issue

描述

Description

On macOS, rtk telemetry status shows device hash: (no salt file) even after running commands that should trigger generate_device_hash() (e.g. rtk gain).

Root cause

The salt_file_path() function uses dirs::data_local_dir(), which on macOS resolves to ~/Library/Application Support/not ~/.local/share/ (Linux convention). However, the auto-creation logic in get_or_create_salt() silently fails, leaving no salt file and no error message.

The telemetry status command reads the salt file path correctly (from ~/Library/Application Support/rtk/.device_salt), but since the file was never created, it falls back to (no salt file).

Steps to reproduce

  1. Fresh install via brew install rtk on macOS
  2. Run rtk gain or any command
  3. Run rtk telemetry status
  4. Observe: device hash: (no salt file)
  5. Check ~/.local/share/rtk/ — directory doesn't exist
  6. Check ~/Library/Application Support/rtk/.device_salt not present

Workaround

cp <some-salt> ~/Library/Application\ Support/rtk/.device_salt

After placing the file in the correct macOS path, rtk telemetry status shows the device hash correctly.

Expected behavior

The salt file should be auto-created at ~/Library/Application Support/rtk/.device_salt on first use on macOS.

Environment

  • OS: macOS (Darwin 25.4.0)
  • RTK version: 0.38.0
  • Installed via: Homebrew

贡献者指南

bug(telemetry): salt file not auto-created on macOS — device hash shows '(no salt file)' · rtk-ai/rtk#1656 | Good First Issue