Update library feature provides much awaited update functionality on registered libraries. As part of the update library user can add new functions, remove unused functions or modify logic of existing functions.
This feature is available when oic.ics.console.library.update feature flag is enabled.
Let's consider a simple Math library that defines basic add function that takes two parameters and is used in an integration.
Suppose you want to add other math functions like subtract, multiply and divide and change the way add operation is executed. You may update the registered library with new JS file that has these new functions using the Update menu on the library list page.
Upload the new JS file using the update library dialog.
When attempting to update the library with new code, the system validates the new library file and ensures it meets the following conditions.
If the new library file adheres to these conditions the library is updated and library edit page is displayed for further configuration changes.
Please note that if the returns parameter for a function used in an integration was changed in the updated library the system does not flag an error but it invalidates the downstream mapping in integrations and should be re-mapped.
Deactivate and activate the integration for changes to take effect in integrations that use the updated library.
Following is an example where the validation conditions are satisfied and the system accepts the uploaded library file.
Add function in math.js is used in integrations so the signature of this function in the updated library file is unchanged even though the add function definition is changed. As mentioned above the containing library file name is also part of a function signature so the file name is unchanged in the updated library. The updated library may contain other function definitions.
Example mentioned below is an illustration where validation fails and uploaded library file is rejected.
As the signature of functions in the new library file do not match with the library in the system, the new library file is rejected.