From 6ac717d584d9c6eba4f16a2c80f5823579a01a9a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 14:45:33 +0000 Subject: [PATCH 1/4] Initial plan From 38941b89fd25f63b066dfb35f33b5f8599ae6394 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 14:54:12 +0000 Subject: [PATCH 2/4] Fix extraneous room key in WCIF activities sent to PATCH endpoint Agent-Logs-Url: https://github.com/coder13/delegateDashboard/sessions/611146a4-df50-473a-8a5f-897d1afb7b4b --- src/store/actions.test.ts | 2 +- .../reducers/_tests_/roundActivities.test.ts | 16 +++++++++++++++- src/store/reducers/roundActivities.ts | 10 ++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/store/actions.test.ts b/src/store/actions.test.ts index 1a06c69..17601b9 100644 --- a/src/store/actions.test.ts +++ b/src/store/actions.test.ts @@ -320,7 +320,7 @@ describe('store actions', () => { type: ActionType.UPLOADING_WCIF, uploading: true, }); - expect(patchWcifMock).toHaveBeenCalledWith('Comp1', { events: wcif.events }); + expect(patchWcifMock).toHaveBeenCalledWith('Comp1', { events: wcif.events, formatVersion: wcif.formatVersion }); expect(dispatch.mock.calls[1][0]).toEqual({ type: ActionType.UPLOADING_WCIF, uploading: false, diff --git a/src/store/reducers/_tests_/roundActivities.test.ts b/src/store/reducers/_tests_/roundActivities.test.ts index 5249327..82cd0b5 100644 --- a/src/store/reducers/_tests_/roundActivities.test.ts +++ b/src/store/reducers/_tests_/roundActivities.test.ts @@ -23,7 +23,21 @@ describe('roundActivities reducers', () => { expect(nextState.needToSave).toBe(true); expect(nextState.changedKeys.has('schedule')).toBe(true); expect(nextActivities[0]).toBe(activityOne); - expect(nextActivities[1]).toBe(updatedActivityTwo); + expect(nextActivities[1]).toEqual(updatedActivityTwo); + }); + + it('updateRoundActivities strips extraneous properties (e.g. room) from stored activities', () => { + const activityOne = buildActivity({ id: 1, name: 'Round 1', activityCode: '333-r1' }); + const room = { id: 10, name: 'Room A', color: '#000', extensions: [], activities: [activityOne] }; + // Simulate ActivityWithRoom: an activity with an extra `room` reference attached internally + const activityWithRoom = { ...activityOne, name: 'Round 1 Updated', room }; + const state = buildState(buildWcif([activityOne])); + + const nextState = updateRoundActivities(state, { activities: [activityWithRoom] }); + + const nextActivity = nextState.wcif?.schedule.venues[0].rooms[0].activities[0]; + expect(nextActivity).not.toHaveProperty('room'); + expect(nextActivity).toEqual(expect.objectContaining({ id: 1, name: 'Round 1 Updated' })); }); it('updateRoundChildActivities updates child activities and keeps other assignments intact', () => { diff --git a/src/store/reducers/roundActivities.ts b/src/store/reducers/roundActivities.ts index 3fc011d..b3eb363 100644 --- a/src/store/reducers/roundActivities.ts +++ b/src/store/reducers/roundActivities.ts @@ -1,7 +1,7 @@ import { mapIn } from '../../lib/utils'; import type { UpdateRoundActivitiesPayload, UpdateRoundChildActivitiesPayload } from '../actions'; import type { AppState } from '../initialState'; -import type { Assignment, Person } from '@wca/helpers'; +import type { Activity, Assignment, Person } from '@wca/helpers'; /** * Updates the child activities of a round activity and also updates the assignments of the persons accordingly @@ -83,7 +83,13 @@ export const updateRoundActivities = ( ...room, activities: room.activities.map((activity) => { const updatedActivity = action.activities.find((a) => a.id === activity.id); - return updatedActivity || activity; + if (!updatedActivity) return activity; + // Strip extraneous properties (e.g. `room`) that may be present from internal use + // but are not valid WCIF schema properties + const { room: _room, ...wcifActivity } = updatedActivity as Activity & { + room?: unknown; + }; + return wcifActivity as Activity; }), })), })), From 74f3ff060696986bf72984cad7f5e53db09918d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 14:56:41 +0000 Subject: [PATCH 3/4] Clarify test: document that updated activity returns a new object Agent-Logs-Url: https://github.com/coder13/delegateDashboard/sessions/611146a4-df50-473a-8a5f-897d1afb7b4b --- src/store/reducers/_tests_/roundActivities.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/store/reducers/_tests_/roundActivities.test.ts b/src/store/reducers/_tests_/roundActivities.test.ts index 82cd0b5..564aa7f 100644 --- a/src/store/reducers/_tests_/roundActivities.test.ts +++ b/src/store/reducers/_tests_/roundActivities.test.ts @@ -23,6 +23,8 @@ describe('roundActivities reducers', () => { expect(nextState.needToSave).toBe(true); expect(nextState.changedKeys.has('schedule')).toBe(true); expect(nextActivities[0]).toBe(activityOne); + // The updated activity is returned as a new object (extraneous props are stripped), so use toEqual + expect(nextActivities[1]).not.toBe(updatedActivityTwo); expect(nextActivities[1]).toEqual(updatedActivityTwo); }); From a7dfbc8f78e2b1b4d8e2c423b1c2126e6696fbad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 May 2026 15:46:04 +0000 Subject: [PATCH 4/4] Fix CI: update lint and type-check workflows to use .nvmrc node version Agent-Logs-Url: https://github.com/coder13/delegateDashboard/sessions/4a527317-cdd4-4217-950f-a7fd969a44cf --- .github/workflows/lint.yml | 2 +- .github/workflows/type-check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f048fd8..172da2f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml index 8dbde80..3f3816a 100644 --- a/.github/workflows/type-check.yml +++ b/.github/workflows/type-check.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies