Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About protecting starting a session with the same name #315

Closed
borsatti2 opened this issue May 1, 2024 · 2 comments
Closed

About protecting starting a session with the same name #315

borsatti2 opened this issue May 1, 2024 · 2 comments
Labels
engine:ALL Related to all engines or basic mechanisms patron:PRO

Comments

@borsatti2
Copy link

borsatti2 commented May 1, 2024

You could create a system that if you try to create a session with the same name, it returns a failure, if the session exists and they are not active, then close it and open a new one, if there is one active (connected) then, do not perform any action

patron:PRO

@allburov allburov added the engine:ALL Related to all engines or basic mechanisms label May 4, 2024
@allburov
Copy link
Contributor

allburov commented May 4, 2024

Fixed in 2024.5.3 (WAHA Plus)

if there is one active (connected) then, do not perform any action

If you perform two POST /api/sessions request with the same name, like

{
  "name": "sessionname",
}

It return response with status code 422 and payload:

{
  "statusCode": 422,
  "message": "Session 'default3' is already started.",
  "error": "Unprocessable Entity"
}

patron:PRO

@allburov allburov closed this as completed May 4, 2024
@allburov
Copy link
Contributor

allburov commented May 4, 2024

If the session exists and it's STOPPED - we restart it

patron:PRO

allburov added a commit that referenced this issue May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine:ALL Related to all engines or basic mechanisms patron:PRO
Projects
None yet
Development

No branches or pull requests

2 participants