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

Add session creation for typebot service #233

Conversation

gabrielpastori1
Copy link
Contributor

The modification is centered around handling cases where a session status update is attempted for a non-existent session. Previously, the service only updated the status of existing sessions. With this update, if a session does not exist when attempting to update its status, a new session is created.

Key Changes:

  1. Added an 'else' block in the Typebot Service to handle the scenario where a session is not found.
  2. In this block, a new session is initialized with a unique sessionId, the current status, creation and update timestamps, and prefilled variables including remoteJid.
  3. This new session is then added to the findData.sessions array, ensuring that the service can manage sessions that were not previously tracked.

@matiasduartee
Copy link

@DavidsonGomes I urgently need this function to create the session if it does not exist.

@DavidsonGomes DavidsonGomes merged commit f8d8744 into EvolutionAPI:develop Dec 5, 2023
@matiasduartee
Copy link

Boa @DavidsonGomes, já vou testar na homolog do docker!!!

@mattostiago
Copy link

Eu testei e deu super certo! Quando tento pausar o typebot, quando não tem sessão aberta, ele cria a sessão e pausa.

@matiasduartee
Copy link

Acabei de testar e esta funcionando perfeitamente!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants