[BUG] Automatic goal sync skips goal.completed webhooks

オープン
#4,073 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

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

@Dhruvdesai793 がすでに取り組んでいます。

2026年12月3日 から。

  • #4079 @Dhruvdesai793 による — オープン

評価

この issue はまだ評価されていません。

説明

bug needs-triage status:assigned
What happened?

Activity-derived goals can reach their target during automatic GitHub sync without dispatching the configured goal.completed webhook. src/lib/goals-sync.ts updates progress but does not detect the incomplete-to-complete transition or dispatch the event. The manual goal PATCH route dispatches completion notifications, but activity-derived progress is updated through /api/goals/sync and the cron route, so subscribers receive no completion event.

Expected: Completing an activity-derived goal through sync emits the same goal.completed event as a manual completion.

Proposed solution: Compare the stored and newly synced progress against the target, dispatch on the first incomplete-to-complete transition, and make repeated syncs idempotent. Add tests for a sync that reaches the target and a repeat sync that must not duplicate the event.

Steps to reproduce
  1. Configure a webhook subscription for goal.completed.
  2. Create an activity-derived goal with a target of one commit.
  3. Record matching GitHub activity and run goal sync (or wait for the cron sync).
  4. Observe that goal progress reaches the target but no completion webhook is sent.
Where is it?

Goals

Where did you see it?

Local development

Browser and device

Not browser-specific: server-side sync/webhook behavior. Local development on Linux x86_64, Node v26.13.1, Vitest 4.1.12.

Screenshots, console errors or logs

No screenshot applies to this server-side behavior. Validation: ./node_modules/.bin/tsc --noEmit completed successfully. Focused existing tests ./node_modules/.bin/vitest run test/goals-sync-lib.test.ts test/weekly-summary-combined.test.ts --reporter=dot passed (2 files, 28 tests), but do not assert webhook dispatch when automatic sync crosses the target. Full ./node_modules/.bin/vitest run: 3,405 passed, 54 failed; all failures were six component suites where JSDOM lacked localStorage, unrelated to goal sync. The sync transition/webhook regression described above is not currently covered.

Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
主要言語
TypeScript
スター
246
フォーク
436
平均マージ
9時間 33分
マージ済み PR(30日)
213

環境構築

はじめの一歩

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

Priyanshu-byte-coder/devtrack のほかの issue

Priyanshu-byte-coder/devtrack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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