Fix 0-point estimate treated as unestimated causing poker loop
All checks were successful
Build & Push Container Image / build (push) Successful in 10s
All checks were successful
Build & Push Container Image / build (push) Successful in 10s
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 <noreply@anthropic.com>
This commit is contained in:
parent
4f5c71e811
commit
f17072116d
2 changed files with 7 additions and 7 deletions
|
|
@ -237,10 +237,10 @@ export async function getSprintIssues(jiraAccountId, sprintId, boardId) {
|
||||||
key: issue.key,
|
key: issue.key,
|
||||||
title: issue.fields?.summary || issue.key,
|
title: issue.fields?.summary || issue.key,
|
||||||
description: issue.fields?.description || null,
|
description: issue.fields?.description || null,
|
||||||
estimate: issue.fields?.[spField] || 0,
|
estimate: issue.fields?.[spField] ?? null,
|
||||||
status: issue.fields?.status?.name || 'Unknown',
|
status: issue.fields?.status?.name || 'Unknown',
|
||||||
reporter: issue.fields?.reporter?.displayName || null
|
reporter: issue.fields?.reporter?.displayName || null
|
||||||
})).filter((issue) => !issue.estimate);
|
})).filter((issue) => issue.estimate == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateIssueEstimate(jiraAccountId, issueIdOrKey, estimate, boardId) {
|
export async function updateIssueEstimate(jiraAccountId, issueIdOrKey, estimate, boardId) {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function startFirstUnestimated(issueList) {
|
function startFirstUnestimated(issueList) {
|
||||||
const issue = issueList.find((i) => !i.estimate || i.estimate === 0);
|
const issue = issueList.find((i) => i.estimate == null);
|
||||||
if (!issue) {
|
if (!issue) {
|
||||||
finishSession();
|
finishSession();
|
||||||
return;
|
return;
|
||||||
|
|
@ -75,13 +75,13 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
||||||
|
|
||||||
const currentKey = activeSessionRef.current.issue.key;
|
const currentKey = activeSessionRef.current.issue.key;
|
||||||
const updated = issuesRef.current.map((i) =>
|
const updated = issuesRef.current.map((i) =>
|
||||||
i.key === currentKey ? { ...i, estimate, estimated: true } : i
|
i.key === currentKey ? { ...i, estimate } : i
|
||||||
);
|
);
|
||||||
issuesRef.current = updated;
|
issuesRef.current = updated;
|
||||||
setIssues(updated);
|
setIssues(updated);
|
||||||
setActiveSession(null);
|
setActiveSession(null);
|
||||||
|
|
||||||
const next = updated.find((i) => !i.estimated && (!i.estimate || i.estimate === 0));
|
const next = updated.find((i) => i.estimate == null);
|
||||||
if (!next) {
|
if (!next) {
|
||||||
finishSession();
|
finishSession();
|
||||||
return;
|
return;
|
||||||
|
|
@ -90,7 +90,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
||||||
setTimeout(() => startSessionForIssue(next), 300);
|
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;
|
const totalCount = issues.length;
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
|
@ -120,7 +120,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
||||||
<p className="text-sm text-slate-600 dark:text-slate-400 m-0 mt-0.5 truncate">{issue.title}</p>
|
<p className="text-sm text-slate-600 dark:text-slate-400 m-0 mt-0.5 truncate">{issue.title}</p>
|
||||||
</div>
|
</div>
|
||||||
<span className="font-bold text-purple-600 dark:text-purple-400 shrink-0">
|
<span className="font-bold text-purple-600 dark:text-purple-400 shrink-0">
|
||||||
{issue.estimate || 0} pts
|
{issue.estimate ?? '–'} pts
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue