-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 5 bugs found during integration testing #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,9 +250,11 @@ export const aggregateHandler = async ( | |
| case "$project": | ||
| pipe = pipe.project(arg as Record<string, unknown>); | ||
| break; | ||
| case "$unwind": | ||
| pipe = pipe.unwind(arg as string); | ||
| case "$unwind": { | ||
| const unwindField = typeof arg === "string" && arg.startsWith("$") ? arg.slice(1) : arg; | ||
| pipe = pipe.unwind(unwindField as string); | ||
| break; | ||
| } | ||
|
Comment on lines
+253
to
+257
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix for If the object form is supported, you should also strip the |
||
| default: | ||
| throw new CommandError(EXIT.USAGE, `unknown aggregation operator: ${op}`); | ||
| } | ||
|
|
||
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.
Adding
awaithere is correct as these operations are asynchronous and must complete before the handler returns to ensure the response is accurate and errors are caught.Note that the same issue appears to exist in
logoutSub(lines 136 and 138 in the full file), whereauth.logoutAll()andauth.logout()are called withoutawait. You should consider applying the same fix there to ensure consistent behavior and proper error handling during logout.