From f17072116d3ef80f6e15b5fbf6137c5821461851 Mon Sep 17 00:00:00 2001 From: Jan Willem Mannaerts Date: Tue, 3 Mar 2026 11:31:04 +0100 Subject: [PATCH] Fix 0-point estimate treated as unestimated causing poker loop Root cause: estimate field used || 0 which collapsed both null (never estimated) and 0 (estimated as zero) into the same value. The filter !estimate then matched both, so saving 0 points left the issue in the unestimated list and advanceToNext re-pokered it. Fix: use ?? null so 0 is a distinct valid estimate, and filter on == null to only match truly unestimated issues. Co-Authored-By: Claude Opus 4.6 --- backend/src/services/jiraService.js | 4 ++-- frontend/src/components/Room.jsx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/services/jiraService.js b/backend/src/services/jiraService.js index 11d234e..ceb89f5 100644 --- a/backend/src/services/jiraService.js +++ b/backend/src/services/jiraService.js @@ -237,10 +237,10 @@ export async function getSprintIssues(jiraAccountId, sprintId, boardId) { key: issue.key, title: issue.fields?.summary || issue.key, description: issue.fields?.description || null, - estimate: issue.fields?.[spField] || 0, + estimate: issue.fields?.[spField] ?? null, status: issue.fields?.status?.name || 'Unknown', reporter: issue.fields?.reporter?.displayName || null - })).filter((issue) => !issue.estimate); + })).filter((issue) => issue.estimate == null); } export async function updateIssueEstimate(jiraAccountId, issueIdOrKey, estimate, boardId) { diff --git a/frontend/src/components/Room.jsx b/frontend/src/components/Room.jsx index a2c1f0a..5c38303 100644 --- a/frontend/src/components/Room.jsx +++ b/frontend/src/components/Room.jsx @@ -34,7 +34,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) { } function startFirstUnestimated(issueList) { - const issue = issueList.find((i) => !i.estimate || i.estimate === 0); + const issue = issueList.find((i) => i.estimate == null); if (!issue) { finishSession(); return; @@ -75,13 +75,13 @@ export default function Room({ room, user, dark, toggleDark, onBack }) { const currentKey = activeSessionRef.current.issue.key; const updated = issuesRef.current.map((i) => - i.key === currentKey ? { ...i, estimate, estimated: true } : i + i.key === currentKey ? { ...i, estimate } : i ); issuesRef.current = updated; setIssues(updated); setActiveSession(null); - const next = updated.find((i) => !i.estimated && (!i.estimate || i.estimate === 0)); + const next = updated.find((i) => i.estimate == null); if (!next) { finishSession(); return; @@ -90,7 +90,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) { setTimeout(() => startSessionForIssue(next), 300); }, []); - const estimatedCount = issues.filter((i) => i.estimated || (i.estimate && i.estimate > 0)).length; + const estimatedCount = issues.filter((i) => i.estimate != null).length; const totalCount = issues.length; if (loading) { @@ -120,7 +120,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {

{issue.title}

- {issue.estimate || 0} pts + {issue.estimate ?? '–'} pts ))}