Bug: Saved reports lose their custom event selection after reload

Đang mở Phù hợp với người mới
#694 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript

Hướng nghiên cứu

Đọc transformReportEventItem() trong packages/core/src/modules/report/report.service.ts và theo dõi cách hàm này xây dựng lại các chuỗi sự kiện cho các lần đọc ở dashboard và editor. Giữ lại customEventId trong kết quả đọc lại, sau đó thêm kiểm thử hồi quy cho các chuỗi sự kiện tùy chỉnh và thông thường. Hoàn tất khi ID sự kiện tùy chỉnh vẫn còn sau khi đọc lại và các chuỗi sự kiện thông thường vẫn hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
7.3k
Fork
552
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Openpanel-dev/openpanel

Tất cả issue của Openpanel-dev/openpanel

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.