Update connection.defaultUserLibraries by fetching the current library list from the server#3069
Open
dariocs wants to merge 1 commit intocodefori:masterfrom
Open
Update connection.defaultUserLibraries by fetching the current library list from the server#3069dariocs wants to merge 1 commit intocodefori:masterfrom
dariocs wants to merge 1 commit intocodefori:masterfrom
Conversation
…y list from the server
Member
|
Hi @dariocs, thanks for looking into this and submitting a fix. Even though that will fix the issue for sure, reloading the current library list every time a command runs (not just actions byt the way, but any command run by the extension) sounds a bit overkill. How about reloading the current library list only when the user connects ? |
Contributor
Author
|
In our case, the user connects and then selects a working environment with
its own library list. Later, without disconnecting, they switch to another
environment with a different library list.
A possible middle ground could be to retry only when the error occurs.
For example, if a command fails due to a missing library (or a library list
mismatch), the extension could automatically reload the current library
list and then retry the command once.
This way:
You avoid reloading the library list for every command.
You still handle environment switches correctly.
The overhead happens only when really needed.
It sounds like a reasonable compromise between performance and reliability.
Il Dom 22 Feb 2026, 14:47 Sébastien Julliand ***@***.***> ha
scritto:
… *sebjulliand* left a comment (codefori/vscode-ibmi#3069)
<#3069 (comment)>
Hi @dariocs <https://github.com/dariocs>, thanks for looking into this
and submitting a fix.
Even though that will fix the issue for sure, reloading the current
library list *every time* a command runs (not just actions byt the way,
but any command run by the extension) sounds a bit overkill.
How about reloading the current library list only when the user connects ?
—
Reply to this email directly, view it on GitHub
<#3069 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGEYEDH75FRMSJCZWTD5V734NGXQJAVCNFSM6AAAAACUYU7IPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNBQHE3TSNBYGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Member
|
@dariocs sounds about right. Or the library list update could happen when the user activates/switches profile (assuming they are using the profiles from the I don't know which approach will be the easiest to implement, I'll leave that up to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Update connection.defaultUserLibraries by fetching the current library list from the server
This PR fixes an issue where connection.defaultUserLibraries was not being updated after changing the user's JOBD profile, causing compilation failures.
How to test this PR
Test Scenario
Steps to Test
Initial Setup - Connect
Connect to your IBM i system using Code for IBM i extension
Use your personal user profile
Verify Current Job Description(JOBD)
Open a 5250 terminal session to the IBM i system
Run the command to display your user profile:
DSPUSRPRF USRPRF(MYUSER)
Note the current JOBD parameter value
Change the User's JOBD
Change your user profile to use a different JOBD with a different library list:
CHGUSRPRF USRPRF(MYUSER) JOBD(MYLIB/NEWJOBD)
This changes the default library list that will be used for new jobs
Test Compilation
In VS Code, compile any program using the Actions feature
The compilation should complete successfully.
❌ Without This Fix (Before PR)
The connection.defaultUserLibraries retained the old library list from the original JOBD
When attempting to remove libraries with the command:
liblist -d ${IBMi.escapeForShell(Tools.sanitizeObjNamesForPase(connection.defaultUserLibraries).join(
))}The command tried to remove libraries that no longer existed in the current job's library list
Compilation failed with library-related errors
Expected Behavior
✅ With This Fix (After PR)
The updateDefaultUserLibraries() function fetches the current library list before compilation
The command to remove libraries in the current job's library list
The compilation succeeds without errors
Technical Details
The issue occurred because:
defaultUserLibraries was set only during initial connection
Our users changed their JOBD because they work in different company (which changes the default library list), the cached value became stale
Compilation attempts to reset the library list by removing the default libraries before adding custom ones
Trying to remove non-existent libraries caused the compilation to fail
This PR ensures the library list is refreshed from the server before each compilation, keeping it synchronized with the current job's actual library list.
Additional Verification
You can also verify the fix by:
Checking the IBM i Output channel for the library list being fetched
Confirming that the compilation log shows the correct library list is being used
Testing with different JOBDs that have significantly different library lists
Checklist
console.logs I added