Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Upgrade fails for Java contract with active debug session #1230

Closed
2 tasks
Jakeeyturner opened this issue Aug 5, 2019 · 4 comments · Fixed by #1354
Closed
2 tasks

Upgrade fails for Java contract with active debug session #1230

Jakeeyturner opened this issue Aug 5, 2019 · 4 comments · Fixed by #1354
Assignees
Labels
bug Something isn't working sev2
Milestone

Comments

@Jakeeyturner
Copy link
Contributor

Description

Unexpected behaviour when trying to upgrade a contract, whilst running a debug session is active.

Found by @liam-grace

Expected Behavior

I'd expect to be asked for a name and version (or just a version if it can obtain the name) and then not error when upgrading.

Actual Behavior

It errors when upgrading (check steps to reproduce)

Possible Fix

Steps to Reproduce

  1. Install and instantiate a Java contract with name 'contract' and version '0.0.1' (from Open Project)
  2. Start debug session with name 'contract' and version '0.0.2'
  3. Try to upgrade smart contract
  4. Straight to 'What function do you want to call?'
  5. Smart contract with version 0.0.2 is already instantiated error

Existing issues

Log File

Your Environment

  • IBM Blockchain Platform Extension Version:
  • Visual Studio Code version:
  • Environment name and version (e.g. Node.js v8.12.0, npm v6.4.1):
  • Operating System and version:
  • Link to your project:
@Jakeeyturner Jakeeyturner added the bug Something isn't working label Aug 5, 2019
@cazfletch cazfletch added this to the Sprint 13 milestone Aug 12, 2019
@cazfletch cazfletch self-assigned this Aug 12, 2019
@cazfletch cazfletch added the sev2 label Aug 12, 2019
@cazfletch
Copy link
Contributor

I tried this and couldn't reproduce. In step 3 you say try to upgrade does this mean you ran the upgrade command or vscode automatically ran the upgrade command?

@Jakeeyturner
Copy link
Contributor Author

The problem seems to occur when you haven't instantiated the contract and then start debug. The configuration.env seems to have the instantiate command as part of the EXTENSION_COMMAND.

This bug doesn't occur If you have instantiated the contract already and then start debug.

@liam-grace
Copy link

I see the same behaviour as @Jakeeyturner. If I try to upgrade a contract running in debug I am not asked for a name or version number

@cazfletch
Copy link
Contributor

The problem happens because of pressing the rebuild button on debug. Before we try to instantiate we should check if it is already instantiated. The same problem will exist for upgrade and we should check that we do actually need to upgrade

@cazfletch cazfletch removed their assignment Aug 14, 2019
@cazfletch cazfletch modified the milestones: Sprint 13, Sprint 14 Aug 15, 2019
@cazfletch cazfletch self-assigned this Aug 29, 2019
Jakeeyturner pushed a commit that referenced this issue Aug 30, 2019
Fixed problem with instantiate or upgrade wrongly being called when reload button is pressed

closes #1230

Signed-off-by: Caroline Fletcher <caroline.fletcher@uk.ibm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working sev2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants