Support for no current library - #3396
Conversation
|
👋 A new build is available for this PR based on 7a166e0. |
|
Thanks for tackling this — the overall approach is right. A few things to address before merging: Blocker — [IBMi.ts] temp library fallback could be set to *CRTDFT When a user's profile has CURLIB=*CRTDFT, QSYS2.QSQLIBL() returns no CURRENT row, so the currentLibrary local variable stays as *CRTDFT. That value gets passed as fallbackTempLib into checkOrCreateTempLibrary. In checkOrCreateTempLibrary (~line 1106 in IBMi.ts), if the configured temp library cannot be created: else if (fallbackTempLib && !fallbackTempLib.startsWith(`Q`)) {
this.config.tempLibrary = fallbackTempLib;
}*CRTDFT is truthy and doesn't start with Q, so it passes the guard and breaks the temp library. The fix belongs in the let currentLibrary: string | undefined; // undefined = no CURRENT row in QSQLIBL
// config gets the honest value for display
if (this.config.currentLibrary.length === 0) {
this.config.currentLibrary = currentLibrary ?? `*CRTDFT`;
}
// fallback temp lib must always be a real library
const tempLibrarySet = await this.checkOrCreateTempLibrary(currentLibrary ?? `QGPL`, callbacks.message);Minor — connectionProfileEditor.ts: case-sensitive check data.currentLibrary === '*CRTDFT' will fail if the user types *crtdft in lowercase. Consider data.currentLibrary.toUpperCase() === '*CRTDFT'. Minor — LibraryListView.ts: library: 'QSYS' on the synthetic node *CRTDFT is not in QSYS. If any context menu action uses object.library, it will land on QSYS unexpectedly. Using library: '*CRTDFT' or an empty string would be more accurate. |
|
Thanks for the effort on this PR — the issue it addresses (#3383) is real, and I understand why it's annoying to see red highlighting when What
Who uses it This is rarely, if ever, set for developers. Most developers on IBM i have a dedicated current library (often it is their own development library) explicitly assigned in their user profile. However, it is fairly common for end-users and batch job profiles on production systems where there is intentionally no designated current library, relying entirely on the library list for object resolution. So while it may seem like an edge case for the developer community that uses this extension, it matters to shops where developers connect as themselves but also manage or impersonate other end-user profiles (e.g., testing/debugging). What the PR does well The changes to What concerns me The change to the default sentinel in // src/api/IBMi.ts ~line 1106 — checkOrCreateTempLibrary()
else if (fallbackTempLib && !fallbackTempLib.startsWith(`Q`)) {
this.config.tempLibrary = fallbackTempLib;
}IMPORTANT! Beyond that, a broader pass is needed. Variable My recommendation The intent of this PR is correct and worth pursuing. But I would suggest not merging it until at minimum the The relevant expansion in // current code
if (!this.has(`&CURLIB`)) {
this.set(`&CURLIB`, config.currentLibrary); // → '*CRTDFT' — invalid as LIB/OBJ qualifier
}
if (!this.has(`\\*CURLIB`)) {
this.set(`\\*CURLIB`, config.currentLibrary); // → '*CRTDFT' — same problem
}The fix — translate // proposed fix
const curlib = config.currentLibrary === `*CRTDFT` ? `*CURLIB` : config.currentLibrary;
if (!this.has(`&CURLIB`)) {
this.set(`&CURLIB`, curlib); // → '*CURLIB' — valid in PGM(*CURLIB/NAME)
}
if (!this.has(`\\*CURLIB`)) {
this.set(`\\*CURLIB`, curlib);
}This one change in Happy to help work through any of this further. The issue and the fix direction are solid — it just needs a bit more depth before it's safe to ship. |
|
@buzzia2001 Given that we closed the issue as not planned, should we close this PR? |
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
@SanjulaGanepola @buzzia2001 @bobcozzi we're back in business on I completed the PR and hopefully covered all the edge cases. It was mostly about using If you can review it and test it a bit, that would be great. Thanks! |
|
@buzzia2001 right! Let's kill it this time. |
|
Temporarily draft again: it will be more accurate to support a blank |
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
|
@codefori/core it's ready for review again. PR description has been updated accordingly. |
|
I can't submit an official review maybe because I've opened this pr... anyway @sebjulliand, some points:
Tomorrow I'll start testing it... |
|
I opened a new PR #3430 so you can make a proper review (and start from a clean history).
Well spotted @buzzia2001 .
I'll check it out as well. |

Changes
This PR enables the user to remove the current library list (the equivalent of using

CHGLIBL CURLIB(*CRTDFT)).It adds a new "Remove Current Library" action in the library list view, on the Current library node.


Using a blank current library or

*CRTDFTin a profile will result in having no current library as well.How to test this PR
Checklist
Closes #3383