-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix contracts types update #3456
Conversation
fix project name to be dedicated to the passed module name
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.
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.
sorry my mistake added the wrong issue, the issue will be fixed on #3423 |
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.
Tested deleting a deployment and its network deleted as well. Good job, @0oM4R!
fix project name to be dedicated to the passed module name
Description
what was the issue ?
In deployment list, all contracts got overwritten to be of type
vm
The cause : while migrating machines of type
FullVM
from old playground, we are settingmoduleName
toFullVm
.tfgrid-sdk-ts/packages/playground/src/utils/migration.ts
Line 11 in ca89db4
but this module name is not exist on
moduleNames
enum,then while listing the contracts we map the passed module name to the moduleNames enum, so the result is undefined,
tfgrid-sdk-ts/packages/grid_client/src/modules/base.ts
Line 262 in ca89db4
and call list function with type
undefine
tfgrid-sdk-ts/packages/grid_client/src/modules/base.ts
Lines 264 to 268 in ca89db4
so in this case all contract on that project name got listed as the listing function checks for the passed type which is in this case undefined so we are listing all the contracts on this project name
tfgrid-sdk-ts/packages/grid_client/src/clients/tf-grid/contracts.ts
Lines 176 to 179 in ca89db4
so the expected to list the contracts with type
FullVm
then change its type to vm but now we are listing all contracts on the project name then overwrite its type to be vmChanges
add nullish coalescing operator to make sure the module name never got undefined if it failed to map
Related Issues
Tested Scenarios
grid.networks.list
to list my contractsDocumentation PR
For UI changes, Please provide the Documetation PR on info_grid
Checklist