main is broken: dispatcher calls removed this.swapLabels (typecheck error + failing test) #258

Closed
opened 2026-11-11 10:51:53 +01:00 by omp-deck · 0 comments
Collaborator

Problem

main at 8d03452 (merge of #249) does not typecheck and has one failing test:

apps/server/src/forgejo/dispatcher.ts(2536,27): error TS2339: Property 'swapLabels' does not exist on type 'ForgejoDispatcher'.
(fail) ForgejoDispatcher own-PR CI > a merged implementation loses the progress label of its issue
  expect(h.api.labelPuts).toEqual([{ number: 4, ids: [] }])
  Received: []

Cause

A semantic merge conflict between the two branches merged into main:

  • a0f3b07 "fix(server): do not report a merged implementation as abandoned" added clearProgressLabel(), which calls this.swapLabels(api, { owner, repo, number }, { add: null, remove: progressLabel }).
  • a690585 "feat(server): mark planned issues with a configurable planned_label" moved that private helper out of the dispatcher into apps/server/src/forgejo/issue-labels.ts as applyLabelDelta, taking lists on both sides.

The merge kept both, so the call site refers to a method that no longer exists. At runtime the TypeError is swallowed by the surrounding try/catch (log.warn("could not remove the progress label …")), so a merged implementation silently keeps its progress label.

Fix

Point clearProgressLabel at applyLabelDelta with list arguments (remove: [progressLabel]), matching the abandon path.

Notes

Found while implementing #254; unrelated to that change, so not fixed in its branch. Both failures reproduce on a pristine checkout of main.

## Problem `main` at 8d03452 (merge of #249) does not typecheck and has one failing test: ``` apps/server/src/forgejo/dispatcher.ts(2536,27): error TS2339: Property 'swapLabels' does not exist on type 'ForgejoDispatcher'. ``` ``` (fail) ForgejoDispatcher own-PR CI > a merged implementation loses the progress label of its issue expect(h.api.labelPuts).toEqual([{ number: 4, ids: [] }]) Received: [] ``` ## Cause A semantic merge conflict between the two branches merged into `main`: - a0f3b07 "fix(server): do not report a merged implementation as abandoned" added `clearProgressLabel()`, which calls `this.swapLabels(api, { owner, repo, number }, { add: null, remove: progressLabel })`. - a690585 "feat(server): mark planned issues with a configurable planned_label" moved that private helper out of the dispatcher into `apps/server/src/forgejo/issue-labels.ts` as `applyLabelDelta`, taking lists on both sides. The merge kept both, so the call site refers to a method that no longer exists. At runtime the `TypeError` is swallowed by the surrounding `try`/`catch` (`log.warn("could not remove the progress label …")`), so a merged implementation silently keeps its progress label. ## Fix Point `clearProgressLabel` at `applyLabelDelta` with list arguments (`remove: [progressLabel]`), matching the abandon path. ## Notes Found while implementing #254; unrelated to that change, so not fixed in its branch. Both failures reproduce on a pristine checkout of `main`.
lucas closed this issue 2026-11-11 11:39:50 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lucas/omp-deck#258
No description provided.