feat(FN-1787): merge fusion/fn-1787
This commit is contained in:
@@ -1044,6 +1044,8 @@ describe("MissionStore", () => {
|
||||
|
||||
expect(linked.taskId).toBe("FN-001");
|
||||
expect(linked.status).toBe("triaged");
|
||||
expect(linked.loopState).toBe("implementing");
|
||||
expect(linked.implementationAttemptCount).toBe(1);
|
||||
expect(taskRow.missionId).toBe(mission.id);
|
||||
expect(taskRow.sliceId).toBe(slice.id);
|
||||
});
|
||||
@@ -1542,6 +1544,8 @@ describe("MissionStore", () => {
|
||||
// Feature should be triaged with a taskId
|
||||
expect(triaged.status).toBe("triaged");
|
||||
expect(triaged.taskId).toBeTruthy();
|
||||
expect(triaged.loopState).toBe("implementing");
|
||||
expect(triaged.implementationAttemptCount).toBe(1);
|
||||
|
||||
// Task should exist with correct properties
|
||||
const task = await ts.getTask(triaged.taskId!);
|
||||
|
||||
@@ -1667,10 +1667,17 @@ export class MissionStore extends EventEmitter<MissionStoreEvents> {
|
||||
|
||||
const linkage = this.resolveTaskLinkage(feature.sliceId);
|
||||
|
||||
// When first linking (loopState is idle or falsy), transition to implementing
|
||||
const shouldTransitionLoop = !feature.loopState || feature.loopState === "idle";
|
||||
const loopStateUpdates: Partial<MissionFeature> = shouldTransitionLoop
|
||||
? { loopState: "implementing", implementationAttemptCount: 1 }
|
||||
: {};
|
||||
|
||||
const updated = this.db.transaction(() => {
|
||||
const featureUpdate = this.updateFeature(featureId, {
|
||||
taskId,
|
||||
status: "triaged",
|
||||
...loopStateUpdates,
|
||||
});
|
||||
|
||||
// Also update the task's mission/slice linkage for bidirectional linking.
|
||||
|
||||
Reference in New Issue
Block a user