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

Custom auth in failure function #28

Merged
merged 25 commits into from
Nov 21, 2024

Conversation

CahidArda
Copy link
Collaborator

@CahidArda CahidArda commented Nov 20, 2024

Run custom auth in failureFunction by default.

also fixes:

  • we checked retries like (retries), so when it was set to 0, it wasn't being set properly.
  • when a context.call is made to an endpoint which returns no body

initial payload is still accessible through context.initialPayload
run state would become run_success. now it becomes run_canceled
they are disabled because they are unreliable in CI. will run locally instead.
when retry was 0, it wasn't being set because of 'if (retries)'.

in context.call, if the endpoint we call returns an undefined body, the body field in the callback is not set. We replace this with empty string.
redis.fail allows us to mark a test as failed. if it's called, checkRedisForResults will fail.
Copy link

linear bot commented Nov 20, 2024

Comment on lines +91 to +93
await redis.increment(route, randomId)
await redis.saveResultsWithoutContext(route, randomId, result)
await redis.checkRedisForResults(route, randomId, 1, result)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we check this? We already know it'd work

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just a checkpoint to make sure that the state is set in redis, and only difference is the failWithoutContext method

@fahreddinozcan fahreddinozcan merged commit b108d18 into main Nov 21, 2024
17 checks passed
@fahreddinozcan fahreddinozcan deleted the DX-1393-auth-in-failure-function branch November 21, 2024 08:43
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.

2 participants