Skip to content

Conversation

@dhasani23
Copy link
Contributor

Problem

If a user runs a transformation, rejects changes, then immediately runs another transformation on the same project (rare, but it happens), we attempt to show the user the old diff (which has already been deleted at this point).

Solution

Reset patchFiles before showing the user the patch file.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested review from a team as code owners December 13, 2024 19:46
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just about to make this change so thanks for catching

@jpinkney-aws jpinkney-aws merged commit 4d462e2 into aws:master Dec 13, 2024
25 of 27 checks passed

let deserializeErrorMessage = undefined
let pathContainingArchive = ''
patchFiles = [] // reset patchFiles if there was a previous transformation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun js trick: you can clear an array by setting its length to zero (so the variable could stay const, above)

patchFiles.length = 0

karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
…s#6238)

## Problem

If a user runs a transformation, rejects changes, then immediately runs
another transformation on the same project (rare, but it happens), we
attempt to show the user the old diff (which has already been deleted at
this point).


## Solution

Reset `patchFiles` before showing the user the patch file.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Co-authored-by: David Hasani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants