Skip to content

テレメトリにインタラクションイベント送信を実装しアプリ起動時にapp_launchを送信 - #6391

Merged
TinyKitten merged 2 commits into
devfrom
feature/interaction-event-telemetry
Jul 11, 2026
Merged

TinyKitten merged 2 commits into
devfrom
feature/interaction-event-telemetry

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

概要

実験的テレメトリ基盤の GraphQL sendInteractionEvent mutation に対応し、インタラクションイベントを送信できる仕組みを useTelemetrySender に追加しました。現時点でアプリが実際に送信するのはアプリ起動時の app_launch イベントのみです。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • useTelemetrySender に sendInteractionEvent(eventName, properties?) を追加(テレメトリ基盤の GraphQL InteractionEventInput に対応。properties はフラットな map のみ許容)
  • 設定復元により telemetry が有効化された時点で、アプリプロセスごとに 1 回だけ app_launch インタラクションイベントを自動送信
  • セッション ID をフックインスタンス毎の生成からモジュールレベル共有に変更し、位置情報・ログ・インタラクションイベントを同一セッション ID で突合できるように変更
  • sendInteractionEvent のペイロード構造・エラーハンドリングと app_launch の一度きり送信を検証する単体テストを追加

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 新機能
    • 操作や画面などのインタラクションイベントをテレメトリとして送信できるようになりました。
    • テレメトリ有効化後、アプリ起動イベント(app_launch)を自動で1回だけ送信します。
  • 改善
    • ログ/テレメトリで同一のセッションIDを継続利用します。
    • 送信失敗やAPIエラー時のログ出力を強化し、テレメトリ無効または送信先未設定時は送信しません。

@TinyKitten TinyKitten self-assigned this Jul 11, 2026
@github-actions github-actions Bot added the react label Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

テレメトリのセッションIDをプロセス共有に変更し、インタラクションイベントのGraphQL送信機能とapp_launchの一度きり送信を追加しました。入力検証、認証、エラー処理、および各動作のテストも追加しています。

Changes

テレメトリイベント

Layer / File(s) Summary
共有セッションとapp_launch送信
src/hooks/useTelemetrySender.ts, src/hooks/useTelemetrySender.appLaunch.test.tsx
セッションIDをプロセス共有に統一し、テレメトリ有効化時のapp_launch送信を一度だけ実行する処理とテストを追加しました。
インタラクションイベントAPI
src/hooks/useTelemetrySender.ts, src/hooks/useTelemetrySender.interaction.test.tsx, src/hooks/useTelemetrySender.enabled.test.tsx
インタラクションイベントのZod検証、認証付きGraphQL POST、レスポンス検証、警告・エラーログ、送信条件のテストを追加しました。
テレメトリテスト基盤
src/utils/test/telemetrySenderTestSetup.tsx
共有モック、Jotaiの初期状態、成功レスポンス、およびインタラクション呼び出し抽出ヘルパーを追加しました。

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Hook as useTelemetrySender
  participant Fetch as global.fetch
  participant API as GraphQL API
  Hook->>Hook: telemetryEnabledを確認
  Hook->>Fetch: app_launchを含むGraphQL POST
  Fetch->>API: sendInteractionEvent mutation
  API-->>Fetch: レスポンス
  Fetch-->>Hook: 送信結果
  Hook->>Hook: 失敗時に再送フラグをリセット
Loading

Poem

ぴょんと跳ねるウサギが見る
起動の足跡、ひとつだけ
同じセッション、仲良く走り
イベントを雲へ届けます
失敗の日には耳で警告
テストの野原も花ざかり

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 主変更であるインタラクションイベント送信と app_launch の自動送信を端的に表しています。
Description check ✅ Passed テンプレートの必須セクションが揃っており、概要・変更内容・テストも具体的に記載されています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/interaction-event-telemetry

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/hooks/useTelemetrySender.ts (2)

93-108: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

モジュールレベル状態によりテストが実行順に依存する設計リスク

telemetrySessionId/hasAppLaunchEventBeenSent をモジュールスコープで共有する設計自体はプロセス単位の意図と合致していますが、テスト側(useTelemetrySender.appLaunch.test.tsx 96-98行目)で「このdescribe内のテストは記述順に依存する」と明記されている通り、テスト間で状態がリセットされず順序依存になっています。将来的にテストランナーがランダム実行やshard分割を行うと壊れる可能性があります。テスト用にリセット関数をエクスポートするなど、テスト分離性を高めることを推奨します。

♻️ 提案例
 let telemetrySessionId: string | null = null;
 const getOrCreateSessionId = (): string => {
   if (telemetrySessionId == null) {
     telemetrySessionId = Crypto.randomUUID();
   }
   return telemetrySessionId;
 };

 let hasAppLaunchEventBeenSent = false;
+
+// テスト専用: モジュールレベル状態をリセットし、テスト間の順序依存を避ける
+export const __resetTelemetrySenderStateForTests = () => {
+  telemetrySessionId = null;
+  hasAppLaunchEventBeenSent = false;
+};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.ts` around lines 93 - 108,
モジュールスコープのtelemetrySessionIdとhasAppLaunchEventBeenSentがテスト間で共有され、実行順序に依存している。getOrCreateSessionId周辺にテストから利用できるリセット手段を追加して両状態を初期値へ戻せるようにし、app_launch関連テストが各ケース開始時にそれを呼び出して独立実行できるよう更新する。

236-306: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

sendInteractionEvent/sendLog/sendTelemetry の定型処理が3重に重複

fetch呼び出し、response.okチェック、JSON parseのtry/catch、zodによるレスポンス検証、errors配列のwarn、外側のtry/catchによるerror loggingという同一パターンが3つの関数(236-306行目, 308-380行目, 382-491行目)で丸ごと複製されています。共通のGraphQL送信ヘルパーへ抽出すれば、今後のエンドポイント変更やエラーハンドリング修正を一箇所で済ませられます。

♻️ 提案(概略)
async function postTelemetryMutation<TResponse>(
  baseUrl: string,
  token: string,
  query: string,
  input: unknown,
  responseSchema: z.ZodType<TResponse>,
  label: string
): Promise<TResponse | null> {
  try {
    const response = await fetch(`${baseUrl}/graphql`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${token}`,
      },
      body: JSON.stringify({ query, variables: { input } }),
    });

    if (!response.ok) {
      console.error(`HTTP error: ${response.status} ${response.statusText}`);
      return null;
    }

    let json: unknown;
    try {
      json = await response.json();
    } catch {
      console.error('Failed to parse response JSON');
      return null;
    }

    const result = responseSchema.safeParse(json);
    if (!result.success) {
      console.error(`Invalid ${label} response:`, result.error, json);
      return null;
    }
    return result.data;
  } catch (error) {
    console.error(`Failed to send ${label}:`, error);
    return null;
  }
}

sendInteractionEvent/sendLog/sendTelemetry はこのヘルパーを呼び、戻り値に対して各自の errors/warning 判定のみ行う形に簡略化できます。同様に SendLocationResponse/SendLogEventResponse/SendInteractionEventResponse の .refine(...) ラッパー(71-87行目, 188-203行目など)も共通のファクトリ関数化が可能です。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.ts` around lines 236 - 306, Extract the
duplicated GraphQL request, HTTP/status handling, JSON parsing, response-schema
validation, and outer error logging from sendInteractionEvent, sendLog, and
sendTelemetry into one shared postTelemetryMutation helper. Have each sender
call the helper with its query, input, response schema, and label, then retain
only its endpoint-specific errors or warnings handling. Do not change the
existing payload construction or sender-specific behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/hooks/useTelemetrySender.appLaunch.test.tsx`:
- Around line 11-95: Extract the shared telemetry test setup from the jest.mock
declarations, wrapper, and mockFetch setup in
useTelemetrySender.appLaunch.test.tsx and
useTelemetrySender.interaction.test.tsx into a reusable helper under
src/utils/test/. Export the common mock configuration and TelemetryTestWrapper,
then update both test files to import and reuse them while preserving their
existing test-specific helpers and behavior.

In `@src/hooks/useTelemetrySender.ts`:
- Around line 501-512: Update sendInteractionEvent so every validation, HTTP,
JSON parsing, and fetch failure path returns false, while successful
transmission returns true. In the useEffect guarded by isTelemetryEnabled,
baseUrl, and hasAppLaunchEventBeenSent, await the result before treating
app_launch as sent and reset hasAppLaunchEventBeenSent on failure so a later
attempt can retry.

---

Nitpick comments:
In `@src/hooks/useTelemetrySender.ts`:
- Around line 93-108:
モジュールスコープのtelemetrySessionIdとhasAppLaunchEventBeenSentがテスト間で共有され、実行順序に依存している。getOrCreateSessionId周辺にテストから利用できるリセット手段を追加して両状態を初期値へ戻せるようにし、app_launch関連テストが各ケース開始時にそれを呼び出して独立実行できるよう更新する。
- Around line 236-306: Extract the duplicated GraphQL request, HTTP/status
handling, JSON parsing, response-schema validation, and outer error logging from
sendInteractionEvent, sendLog, and sendTelemetry into one shared
postTelemetryMutation helper. Have each sender call the helper with its query,
input, response schema, and label, then retain only its endpoint-specific errors
or warnings handling. Do not change the existing payload construction or
sender-specific behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 470be181-daaa-43af-8587-6a1653827555

📥 Commits

Reviewing files that changed from the base of the PR and between 6464b80 and 14b0861.

📒 Files selected for processing (3)
  • src/hooks/useTelemetrySender.appLaunch.test.tsx
  • src/hooks/useTelemetrySender.interaction.test.tsx
  • src/hooks/useTelemetrySender.ts

Comment thread src/hooks/useTelemetrySender.ts Resolved

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (4)
src/hooks/useTelemetrySender.ts (2)

93-108: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

モジュールレベルの共有状態によりテスト分離性が低下する。

telemetrySessionId と hasAppLaunchEventBeenSent はプロセス全体で共有する設計意図は理解できますが、リセット手段が一切ないため、テスト側で「記述順に依存する」という運用が必須になっています(実際に useTelemetrySender.appLaunch.test.tsx の NOTE コメントで明示されている通りです)。加えて useTelemetrySender.interaction.test.tsx でも同じモジュールフラグが最初のテストの mount 時に一度だけ副作用として app_launch を送信してしまい、以降のテストでは送信されないという非対称な挙動が暗黙的に発生しています。

また hasAppLaunchEventBeenSent = true は sendInteractionEvent の呼び出し結果を待たずに同期的にセットされるため、初回のネットワーク送信が失敗した場合、プロセスの残り寿命の間 app_launch イベントは二度と送信されません(fire-and-forget の代償として「最大1回」ではなく「0~1回」になる)。

テスト用にモジュール状態をリセットできる内部エクスポート(例: __resetTelemetrySessionForTests)を用意すると、テストの実行順依存を解消しやすくなります。

♻️ テスト用リセットフックの追加例
 let telemetrySessionId: string | null = null;
+
+// テスト専用: モジュールレベルの状態をリセットする
+export const __resetTelemetrySessionForTests = () => {
+  telemetrySessionId = null;
+  hasAppLaunchEventBeenSent = false;
+};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.ts` around lines 93 - 108,
モジュール共有状態をテストからリセットできる内部エクスポートを追加してください。useTelemetrySender.ts の
telemetrySessionId と hasAppLaunchEventBeenSent の両方を初期値へ戻す
__resetTelemetrySessionForTests 相当の関数を実装し、テストごとに呼び出せるようにして実行順依存を解消してください。

Source: Coding guidelines


236-306: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

sendLog/sendTelemetry とのGraphQL送信ロジックの重複。

sendInteractionEvent は fetch → HTTPエラー処理 → JSONパース → Zod検証 → errors配列の警告、という一連の処理を sendLog(Lines 308-380)・sendTelemetry(Lines 382-491)とほぼ同一の形で3重に実装しています。共通のGraphQLミューテーション送信ヘルパー(baseUrl/token/query/variables/レスポンススキーマを受け取る)へ抽出すると、今後の4番目のイベント種別追加時の重複をさらに防げます。

♻️ 共通ヘルパー抽出のイメージ
async function postGraphQLMutation<T>(
  baseUrl: string,
  token: string,
  query: string,
  variables: Record<string, unknown>,
  responseSchema: z.ZodType<T>
): Promise<T | null> {
  // fetch + HTTPエラー + JSON parse + zod validate をここに集約
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.ts` around lines 236 - 306, Extract the
duplicated GraphQL request flow from sendInteractionEvent, sendLog, and
sendTelemetry into one shared postGraphQLMutation helper accepting baseUrl,
token, query, variables, and the response schema. Centralize fetch, HTTP-status
handling, JSON parsing, and Zod validation there, while preserving each caller’s
existing API errors warning and failure behavior.
src/hooks/useTelemetrySender.interaction.test.tsx (1)

133-167: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

マウント時の自動 app_launch 送信が本テストの意図と混在している。

各テストで useTelemetrySender(false, 'https://example.com', 'test-token') をレンダーすると、isTelemetryEnabled: true かつ baseUrl あり・モジュールフラグ未設定の初回テスト(このテスト)でマウント時に自動で app_launch イベントも送信されます。findInteractionCall(eventName) でフィルタしているため現状のアサーションは壊れませんが、toHaveBeenCalledTimes 系のアサーションを将来追加すると、このファイル内のどのテストが最初に実行されたかによって呼び出し回数が変わり、意図しないフレーキーな失敗を招く可能性があります。useTelemetrySender.ts 側でモジュール状態のリセット手段を用意し、beforeEach でリセットしておくと安全です。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.interaction.test.tsx` around lines 133 - 167,
Provide a reset mechanism for the module-level telemetry state in
useTelemetrySender, then invoke it from beforeEach in the interaction tests.
Ensure each test starts with clean state so the mount-time automatic app_launch
event does not depend on prior test execution order or affect call-count
assertions.
src/hooks/useTelemetrySender.appLaunch.test.tsx (1)

11-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

テストセットアップの重複コード。

このファイルの jest.mock 群・wrapper・mockFetch の初期化ロジック(Lines 11-120)は useTelemetrySender.interaction.test.tsx の同範囲とほぼ完全に一致しています。ガイドラインの通り、共有ヘルパーを src/utils/test/ に切り出して重複を排除することをお勧めします。

As per coding guidelines, **/*.test.{ts,tsx}: "Reuse helper utilities from src/utils/test/ to avoid duplicate setup code in tests."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.appLaunch.test.tsx` around lines 11 - 56,
Extract the duplicated Jest mocks, wrapper setup, and mockFetch initialization
shared by the app-launch and interaction tests into reusable helpers under
src/utils/test/. Update useTelemetrySender.appLaunch.test.tsx and
useTelemetrySender.interaction.test.tsx to import and use those helpers,
preserving their existing test behavior and per-test configuration.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/hooks/useTelemetrySender.appLaunch.test.tsx`:
- Around line 11-56: Extract the duplicated Jest mocks, wrapper setup, and
mockFetch initialization shared by the app-launch and interaction tests into
reusable helpers under src/utils/test/. Update
useTelemetrySender.appLaunch.test.tsx and
useTelemetrySender.interaction.test.tsx to import and use those helpers,
preserving their existing test behavior and per-test configuration.

In `@src/hooks/useTelemetrySender.interaction.test.tsx`:
- Around line 133-167: Provide a reset mechanism for the module-level telemetry
state in useTelemetrySender, then invoke it from beforeEach in the interaction
tests. Ensure each test starts with clean state so the mount-time automatic
app_launch event does not depend on prior test execution order or affect
call-count assertions.

In `@src/hooks/useTelemetrySender.ts`:
- Around line 93-108:
モジュール共有状態をテストからリセットできる内部エクスポートを追加してください。useTelemetrySender.ts の
telemetrySessionId と hasAppLaunchEventBeenSent の両方を初期値へ戻す
__resetTelemetrySessionForTests 相当の関数を実装し、テストごとに呼び出せるようにして実行順依存を解消してください。
- Around line 236-306: Extract the duplicated GraphQL request flow from
sendInteractionEvent, sendLog, and sendTelemetry into one shared
postGraphQLMutation helper accepting baseUrl, token, query, variables, and the
response schema. Centralize fetch, HTTP-status handling, JSON parsing, and Zod
validation there, while preserving each caller’s existing API errors warning and
failure behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 470be181-daaa-43af-8587-6a1653827555

📥 Commits

Reviewing files that changed from the base of the PR and between 6464b80 and 14b0861.

📒 Files selected for processing (3)
  • src/hooks/useTelemetrySender.appLaunch.test.tsx
  • src/hooks/useTelemetrySender.interaction.test.tsx
  • src/hooks/useTelemetrySender.ts

@TinyKitten

Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 5 file(s) based on 2 CodeRabbit feedback item(s).

Applied fixes:

  1. app_launch送信失敗時に再送不能になる問題 — sendInteractionEvent が送信の成否(Promise<boolean>)を返すようにし、app_launch 送信失敗時は送信済みフラグを戻して後続のマウントで再送できるようにしました。失敗→再送のテストも追加しています。
  2. テストセットアップの重複 — useTelemetrySender.interaction.test.tsx / useTelemetrySender.appLaunch.test.tsx で全文重複していた jest.mock 群・wrapper・fetch モックを src/utils/test/telemetrySenderTestSetup.tsx に共通化しました(既存の ttsMocks.ts と同じ共有セットアップパターン)。

Files modified:

  • src/hooks/useTelemetrySender.ts
  • src/hooks/useTelemetrySender.interaction.test.tsx
  • src/hooks/useTelemetrySender.appLaunch.test.tsx
  • src/hooks/useTelemetrySender.enabled.test.tsx
  • src/utils/test/telemetrySenderTestSetup.tsx (new)

Validation: npm run lint / npm run typecheck / npm test (2044 tests) all passing.

Commit: 42346b03e

The latest autofix changes are on the feature/interaction-event-telemetry branch.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (2)
src/hooks/useTelemetrySender.appLaunch.test.tsx (1)

16-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

モジュールレベル状態への依存によるテスト順序依存を解消することを推奨します。

コメントで明示されている通り、hasAppLaunchEventBeenSent と telemetrySessionId が useTelemetrySender.ts のモジュールスコープで共有されるため、この describe 内のテストは記述順に強く依存しています。将来テストが追加・並び替えされた場合に静かに壊れるリスクがあります。

useTelemetrySender.ts 側にテスト専用のリセット関数を追加し、beforeEach で呼び出すことで順序依存を排除できます。

♻️ 提案例
// src/hooks/useTelemetrySender.ts (テスト専用エクスポート)
export const __resetTelemetryStateForTests = () => {
  telemetrySessionId = null;
  hasAppLaunchEventBeenSent = false;
};
+import { __resetTelemetryStateForTests } from '~/hooks/useTelemetrySender';
+
 describe('useTelemetrySender (app_launch event)', () => {
   beforeEach(() => {
+    __resetTelemetryStateForTests();
     mockFetch = setupTelemetrySenderMocks();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useTelemetrySender.appLaunch.test.tsx` around lines 16 - 18,
Eliminate test-order dependence in the app_launch tests by adding a test-only
reset function near the module-level state in useTelemetrySender.ts that clears
hasAppLaunchEventBeenSent and telemetrySessionId, then invoke it from beforeEach
in the useTelemetrySender (app_launch event) describe block.
src/utils/test/telemetrySenderTestSetup.tsx (1)

106-117: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

telemetrySenderTestSetup.tsx の useAtomValue モックを atom ごとに分けてください
locationAtom / arrivedAtom / approachingAtom に同じ truthy 値を返しているため、useTelemetrySender の state は実質 arrived に固定されます。今の enabled テストは arrived を期待しているので通りますが、moving / approaching / passing を扱うケースを増やすなら mockImplementation で分岐させたほうが安全です。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/utils/test/telemetrySenderTestSetup.tsx` around lines 106 - 117, Update
the useAtomValue mock in telemetrySenderTestSetup.tsx to use mockImplementation
and return values based on the requested atom: keep the location payload for
locationAtom, and return independent values for arrivedAtom and approachingAtom.
Preserve the existing enabled test expectations while allowing moving,
approaching, and passing states to be configured without every atom receiving
the same truthy object.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/hooks/useTelemetrySender.appLaunch.test.tsx`:
- Around line 16-18: Eliminate test-order dependence in the app_launch tests by
adding a test-only reset function near the module-level state in
useTelemetrySender.ts that clears hasAppLaunchEventBeenSent and
telemetrySessionId, then invoke it from beforeEach in the useTelemetrySender
(app_launch event) describe block.

In `@src/utils/test/telemetrySenderTestSetup.tsx`:
- Around line 106-117: Update the useAtomValue mock in
telemetrySenderTestSetup.tsx to use mockImplementation and return values based
on the requested atom: keep the location payload for locationAtom, and return
independent values for arrivedAtom and approachingAtom. Preserve the existing
enabled test expectations while allowing moving, approaching, and passing states
to be configured without every atom receiving the same truthy object.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82012c81-21e1-495e-8213-1f389dc7dff0

📥 Commits

Reviewing files that changed from the base of the PR and between 14b0861 and 42346b0.

📒 Files selected for processing (5)
  • src/hooks/useTelemetrySender.appLaunch.test.tsx
  • src/hooks/useTelemetrySender.enabled.test.tsx
  • src/hooks/useTelemetrySender.interaction.test.tsx
  • src/hooks/useTelemetrySender.ts
  • src/utils/test/telemetrySenderTestSetup.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/hooks/useTelemetrySender.interaction.test.tsx
  • src/hooks/useTelemetrySender.ts

@TinyKitten
TinyKitten merged commit fb3d26e into dev Jul 11, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the feature/interaction-event-telemetry branch July 11, 2026 08:48
This was referenced Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant