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]: Retriving data from API for poker game fails if the game is still open in the browser #641

Closed heinezen closed 2 weeks ago

heinezen commented 2 weeks ago

Contact Details

No response

What happened?

When I try to retrieve a poker game info from the /battles/{battleId} endpoint in the Thunderdome API, I currently receive a 403 response if I have the game open in a browser window. The JSON response returned is

{
  "success": false,
  "error": "USER_MUST_JOIN_BATTLE",
  "data": {},
  "meta": {}
}

This is a bit annoying, especially if I just participated in a poker game and want to get the data via the API.

How To Reproduce

  1. Create a new poker game in Thunderdome
  2. Join the game in your browser and leave the tab open
  3. Make an API request to the GET /battles/{battleId} endpoint with battleId set to the ID of the created game, e.g. via the Swagger UI

Possible Causes

I think this might be linked to the internal session management, since you can't join the same game twice with the same account in your browser too. However, from an REST API I would expect different behavior, i.e. that the API request is not linked to any session.

I suspect that the API request triggers a game join at some point, which fails because the browser session already exists. This then leads to the error USER_MUST_JOIN_BATTLE when the data is accessed.

Self Hosted?

No

Version

Latest

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct