StevenWeathers / thunderdome-planning-poker

⚡ Thunderdome is an open source agile planning poker, sprint retro, and story mapping tool
https://thunderdome.dev
Apache License 2.0
421 stars 109 forks source link

[Bug]: Creating poker game via API ignores `priority` field in story plans #643

Closed heinezen closed 2 weeks ago

heinezen commented 2 weeks ago

Contact Details

No response

What happened?

It looks like the priority field in poker stories gets silently ignored when I try to create a new poker game via the API. It happends for both endpoints that can create games, i.e:

There is no error message and the response body that is supposed to show the created game even contains the correct priority for the plans. However, when I view the game in the browser or retrieve the battle from the GET /battles/{battleId} endpoint, the priority of the plans is reset to 99 (no priority).

How To Reproduce

  1. Create a new poker game via the API, e.g. using the POST /users/{userId}/battles endpoint. This body payload should work as an example:
{
  "autoFinishVoting": true,
  "hideVoterIdentity": true,
  "joinCode": "test",
  "leaderCode": "test",
  "name": "Test",
  "plans": [
    {"id": "1234", "name": "Test", "priority": 2, "referenceId": "test", "type": "Task"}
  ],
  "pointAverageRounding": "ceil",
  "pointValuesAllowed": ["0", "1", "2", "3", "5", "8", "13", "20", "40", "100", "?", "☕️"]
}
  1. Observe the API response. It should look like this:
{
  "success": true,
  "error": "",
  "data": {
    "id": "d57bb507-f97c-4c59-8d6a-3ced63290c8f",
    "name": "Test",
    "users": [],
    "plans": [
      {
        "id": "a8af01d3-e942-4b55-8dcc-2100ceaaca1d",
        "name": "Test",
        "type": "Task",
        "referenceId": "test",
        "link": "",
        "description": "",
        "acceptanceCriteria": "",
        "priority": 2,
        "votes": [],
        "points": "",
        "active": false,
        "skipped": false,
        "voteStartTime": "0001-01-01T00:00:00Z",
        "voteEndTime": "0001-01-01T00:00:00Z",
        "position": 0
      }
    ],
    "votingLocked": true,
    "activePlanId": "",
    "pointValuesAllowed": [
      "0",
      "1",
      "2",
      "3",
      "5",
      "8",
      "13",
      "20",
      "40",
      "100",
      "?",
      "☕️"
    ],
    "autoFinishVoting": true,
    "leaders": [
      "08345b7c-284c-490d-bf6f-56f0371b2bde"
    ],
    "pointAverageRounding": "ceil",
    "hideVoterIdentity": true,
    "joinCode": "test",
    "leaderCode": "test",
    "teamId": "",
    "teamName": "",
    "estimationScaleId": "054b45f4-063d-47a8-b6ea-1093c4228586",
    "createdDate": "0001-01-01T00:00:00Z",
    "updatedDate": "0001-01-01T00:00:00Z"
  },
  "meta": {}
}
  1. Make an API request to GET /battles/{battleId} using the game ID from the previous API response. The priority of the plan is now 99.

Self Hosted?

No

Version

Latest

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

heinezen commented 2 weeks ago

Side note: Setting the priority does work when creating the poker story separately, i.e. using the POST /battles/{battleId}/plans endpoint. This is currently my workaround.