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

Jcn 469 implement state event parameter #15

Merged
merged 4 commits into from
Feb 1, 2024

Conversation

Alejandro-Gonzalez
Copy link
Contributor

@Alejandro-Gonzalez Alejandro-Gonzalez commented Jan 23, 2024

Link al ticket

Historia

Subtarea

Descripción del requerimiento

Se modificó el package sls-helper-plugin-janis para que llegue un nuevo dato en el evento de las lambdas de las tasks de las state-machines(https://janiscommerce.atlassian.net/browse/JCN-466)

La property nueva es state y esta debe ser accesible por la lambda de la task que la utiliza.

Esto específicamente para saber si una ejecución es un retry o para saber que numero de retry es la ejecución actual.

Descripción de la solución

Se modificaron algunas clases donde se van pasando los datos de los eventos a los lambdas haciéndole llegar el nuevo dato de state y se agregaron nuevos métodos setearlos y getearlo desde la lambda.

Changelog

### Added
- Add new getter for lambda for access state-machine task state

@@ -81,6 +83,9 @@ module.exports = class Dispatcher {

if(typeof taskToken !== 'undefined' && typeof taskToken !== 'string')
throw new LambdaError('Task token must be a string if present', LambdaError.codes.INVALID_TASK_TOKEN);

if(typeof state !== 'undefined' && typeof state !== 'object')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que onda si llega null? te lo va a tomar como objeto 👀

lib/lambda-bases/lambda.js Outdated Show resolved Hide resolved
@jormaechea jormaechea merged commit 0b9c58e into master Feb 1, 2024
6 checks passed
@jormaechea jormaechea deleted the JCN-469-implement-state-event-parameter branch February 1, 2024 20:38
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