Skip to content

Commit f308dfa

Browse files
authored
Fix namespace pick when trying to connect without permissions on %SYS (#1097)
1 parent 6a53a7a commit f308dfa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,12 @@ export class AtelierAPI {
439439
}
440440
}
441441

442-
public serverInfo(): Promise<Atelier.Response<Atelier.Content<Atelier.ServerInfo>>> {
442+
public serverInfo(checkNs = true): Promise<Atelier.Response<Atelier.Content<Atelier.ServerInfo>>> {
443443
return this.request(0, "GET").then((info) => {
444444
if (info && info.result && info.result.content && info.result.content.api > 0) {
445445
const data = info.result.content;
446446
const apiVersion = data.api;
447-
if (this.ns && this.ns.length && !data.namespaces.includes(this.ns)) {
447+
if (this.ns && this.ns.length && !data.namespaces.includes(this.ns) && checkNs) {
448448
throw {
449449
code: "WrongNamespace",
450450
message: `This server does not have specified namespace '${this.ns}'.\n

src/commands/addServerNamespaceToWorkspace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function pickServerAndNamespace(message?: string): Promise<{ server
4141
// Connect and fetch namespaces
4242
const api = new AtelierAPI(uri);
4343
const allNamespaces: string[] | undefined = await api
44-
.serverInfo()
44+
.serverInfo(false)
4545
.then((data) => data.result.content.namespaces)
4646
.catch((reason) => {
4747
// Notify user about serverInfo failure

src/commands/connectFolderToServerNamespace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function connectFolderToServerNamespace(): Promise<void> {
5454
// Connect and fetch namespaces
5555
const api = new AtelierAPI(uri);
5656
const allNamespaces: string[] | undefined = await api
57-
.serverInfo()
57+
.serverInfo(false)
5858
.then((data) => data.result.content.namespaces)
5959
.catch((reason) => {
6060
// Notify user about serverInfo failure

0 commit comments

Comments
 (0)