-
Notifications
You must be signed in to change notification settings - Fork 3
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
Return 400 on auth failure #35
Conversation
new Response(JSON.stringify({ workflowRunId }), { | ||
onStepFinish: (workflowRunId: string, finishCondition: FinishCondition) => { | ||
if (finishCondition === "auth-fail") { | ||
console.error(AUTH_FAIL_MESSAGE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can log with debug?.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we have both? If we only have debug, then the user won't understand what's happening if they get this error uninentionally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug.log is async. onStepFinish would have to be async. it's a breaking change. I think we should do it later.
|
||
const { messageId } = await qstash.startWorkflow({ route, headers, payload }, randomTestId) | ||
|
||
// sleep for 4 secs and check that message is delivered | ||
await new Promise(r => setTimeout(r, 4000)); | ||
|
||
await qstash.checkWorkflowStart(messageId) | ||
try { | ||
await qstash.checkWorkflowStart(messageId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the case shouldWorkflowStart
is false
, but the workflow starts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did check this case today, and realised that checkWorkflowStart doesn't work as I expect at all :D
I will remove it altogether in #32 after we merge this. I didn't want to cause conflicts.
We now return
status: 400
in response to auth failures. The text of the message reads:The caveat is being updated with upstash/docs#336. See the preview
Also did the following in the CI: