-
Notifications
You must be signed in to change notification settings - Fork 79
fix(shell-api): do not forward auth errors on completion MONGOSH-719 #811
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 |
---|---|---|
|
@@ -308,7 +308,7 @@ export default class ShellInternalState { | |
const collectionNames = await this.currentDb._getCollectionNamesForCompletion(); | ||
return collectionNames.filter((name) => name.startsWith(collName)); | ||
} catch (err) { | ||
if (err.code === ShellApiErrors.NotConnected) { | ||
if (err.code === ShellApiErrors.NotConnected || err.codeName === 'Unauthorized') { | ||
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. Should 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. This is not a shell error, though, it’s a server error :) 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. Makes sense! |
||
return []; | ||
} | ||
throw err; | ||
|
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.
Just super random thought .. we could have
const TAB = "\u0009";
anddb.vers${TAB}${TAB}
or something .. not a life changing one :)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.
Sounds good, we already do that for e.g. arrow-up in the other tests. I’ll do that right after merging this.