Bug: Saved reports lose their custom event selection after reload

オープン 初心者向け
#694 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

packages/core/src/modules/report/report.service.ts の transformReportEventItem() を読み、ダッシュボードとエディターの読み取り時にイベント系列をどのように再構築するかを追ってください。読み戻し結果で customEventId を保持し、カスタムイベント系列と通常のイベント系列の回帰テストを追加してください。カスタムイベント ID が読み戻し後も保持され、通常のイベント系列が引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

A line chart using a saved custom event shows data in Report Builder. After the report is saved to a dashboard and reopened, it can show No data. The event picker still lists the custom event, but the selected row is a second entry with the same name labeled Not tracked yet.

The save path preserves customEventId in the report's event series. The shared report readback function drops it when rebuilding the series. The chart then queries for a raw event with the custom event's display name.

Version checked

  • Repository: Openpanel-dev/openpanel
  • Affected version: v3.28.0 (ae97a52bf5dd4516178a262573734931500d2544)
  • Also checked: main at 21e87d3388b51e7fc8cd6e219709ab2162f2ae60 has the same omission in the readback function.
  • Verification: the UI behavior was observed in a self-hosted deployment based on v3.28.0. The write-payload, readback, and event-matching helpers from the upstream tag were exercised locally in memory with synthetic data. A full browser/API/database test on a clean upstream instance remains unverified.

Steps to reproduce

  1. In a test project, track checkout_started and checkout_resumed. Use Checkout activity only as the name of a custom event.
  2. Under Project settings → Events, create the custom event Checkout activity from those two tracked events.
  3. In Report Builder, create a line chart with a fixed time range that contains both events. Pick Checkout activity from the row labeled Custom event and confirm that the preview shows data.
  4. Save the report to a dashboard. Reload the dashboard and reopen the saved report. Keep the same time range and filters for the comparison.
  5. Open the event picker and check which Checkout activity row is selected.

Expected behavior

The saved report still selects the Custom event row and shows the same results for the same time range and filters. The query continues to use the custom event's current definition.

Actual behavior

The chart shows No data. The picker contains both Checkout activity entries. The one labeled Not tracked yet is selected.

In the synthetic check, the write payload contained customEventId: "custom-1". The readback kept name: "Checkout activity" and omitted the ID. The query helpers resolved checkout_started and checkout_resumed before save, and only Checkout activity after readback. Saving edits to the reloaded report can also overwrite the stored reference because Update replaces the event series with the submitted series.

Relevant source

Suggested fix and regression coverage

Preserve the optional customEventId in transformReportEventItem() and keep resolving the custom event's current definition at query time.

Add a regression test for reading back a saved event series with customEventId and a regular event series without it. In the UI, save and reopen a custom-event report, change only its title, save again, and verify that the selection and chart results still match.

主要言語
TypeScript
スター
7.3k
フォーク
552
平均マージ
1日 2時間
マージ済み PR(30日)
18

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Openpanel-dev/openpanel のほかの issue

Openpanel-dev/openpanel の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。