Skip to content
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

Attempt to reattach debugger when startDebugging returns undefined #414

Merged

Conversation

awschristou
Copy link
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Infrastructure (change which improves the lifecycle management (CI/CD, build, package, deploy, lint, etc) of the application, but does not change functionality.)
  • Technical debt (change which improves the maintainability of the codebase, but does not change functionality)
  • Testing (change which modifies or adds test coverage, but does not change functionality)
  • Documentation (change which modifies or adds documentation, but does not change functionality)

Description

vscode.debug.startDebugging is expected to return true/false. Try again if it returns undefined.

Motivation and Context

Related Issue(s)

Testing

Screenshots (if appropriate)

Checklist

  • I have read the README document
  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

if (isDebuggerAttached === undefined) {
isDebuggerAttached = false
shouldRetry = numAttempts < MAX_DEBUGGER_ATTEMPTS
} else if (!isDebuggerAttached) {
retryDelay *= 2

shouldRetry = retryEnabled && retryDelay < 10000 ? true : false
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a check against MAX_DEBUGGER_ATTEMPTS here as well?

@codecov-io
Copy link

codecov-io commented Mar 26, 2019

Codecov Report

Merging #414 into feature/python-debug will decrease coverage by 0.07%.
The diff coverage is 0%.

Impacted file tree graph

@@                   Coverage Diff                    @@
##           feature/python-debug     #414      +/-   ##
========================================================
- Coverage                 49.76%   49.68%   -0.08%     
========================================================
  Files                       105      105              
  Lines                      3997     4001       +4     
  Branches                    592      593       +1     
========================================================
- Hits                       1989     1988       -1     
- Misses                     2008     2013       +5
Impacted Files Coverage Δ
src/shared/codelens/localLambdaRunner.ts 0% <0%> (ø) ⬆️
src/shared/utilities/childProcess.ts 89.65% <0%> (-3.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75113f2...baa9ca2. Read the comment docs.

Copy link
Contributor

@bryceitoc9 bryceitoc9 left a comment

Choose a reason for hiding this comment

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

Good for now, but maybe flag for cleanup later re: logging.

retryDelay *= 2

shouldRetry = retryEnabled && retryDelay < 10000 ? true : false
shouldRetry = retryEnabled && (numAttempts < MAX_DEBUGGER_ATTEMPTS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the retryDelay check here will still work but it'll make the channelLogger.info call later worthless.

Copy link
Contributor

Choose a reason for hiding this comment

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

Disregard

@awschristou awschristou merged commit f07723c into feature/python-debug Mar 26, 2019
@awschristou awschristou deleted the awschristou/python-reattach-on-undefined branch March 26, 2019 19:50
leigaol added a commit to leigaol/aws-toolkit-vscode that referenced this pull request Jun 28, 2022
* feat: integrate cognito idp with consolas

* fix: address pr feedback

* [Consolas][High] Consolas Security Scan UX for VSC and C9 (aws#402)

* Consolas security scan feature for VSC and C9

* Merge security scan nodes

* Update panel and commands titles

* Make re-scan for VSC in one line

* Extract activation of security scan into a function

* Webviewview panel & view title changes

* Adjust validation range in panel

* Address comments

* Use Command URI

* fix: update file name and identity pool ids

* chore: update consolas api model

* Swith to use @types/codicons (aws#414)

* feat: add consolas token input

* [Consolas][High] Add context truncation which uses dependency graph algorithm for java and python (aws#415)

* Consolas security scan feature for VSC and C9

* Merge security scan nodes

* Update panel and commands titles

* Make re-scan for VSC in one line

* Extract activation of security scan into a function

* Webviewview panel & view title changes

* Dependency graphs working solution

* Fixed working solution with java edge cases

* Integrate with StartScan command

* Clean code base and remove useless

* [Consolas][High] Consolas Security Scan UX for VSC and C9 (aws#402)

* Consolas security scan feature for VSC and C9

* Merge security scan nodes

* Update panel and commands titles

* Make re-scan for VSC in one line

* Extract activation of security scan into a function

* Webviewview panel & view title changes

* Adjust validation range in panel

* Address comments

* Use Command URI

* Swith to use @types/codicons

* Use vscode.Uri.file

* Use path.join

* Reduce property number

* Factory pattern for dependency graph

* Abstract some methods and the parent class

* Set timeout for context truncation

* feat: update UX for consolas token input

* fix: address pr feedback

* fix: throw if access token is undefined

* refactor: accountless commands and nodes

* [Consolas][High] Follow up updates for PR-415 (aws#423)

* Address additional comments from PR-415

* Handle import static ...

* Simplify raw path jon statement

* Consolas Pagination

* Paginated fully working with automatic trigger

* Fix old test cases

* Add pagination for manual trigger

* Add status bar Item for Consolas for pagination

* Exit scenerios for pagination

* ChangeRecommendationname&Exitstatefix

* NextResponsetestcase

* feat: add access token to request header

* fix: invalidate the access token on validation error

* Statusbarfix

* Minor bug fixes

* Updated inline to singleton class and fixed test cases

* resolveconflicts

* remove global var telemetry context

* fix: hide accountless for cloud9

* Bug: status bar not visible after VsCode restart

* update

* fix bug in test cases

* add package-lock.json change

* remove inline completion global variable

* Add Prod endpoint back to consolas

* [Consolas][High] CodeScan E2E working solution (with dev endpoint) (aws#431)

* Address additional comments from PR-415

* Handle import static ...

* Simplify raw path jon statement

* E2E working solution plus down-to file level truncation for Java

* Address comments

* Updated sdk model

* Use pageableToCollection for listing

* Refactor based on comments

* add hack for access token

* fix bug

* Bug fixing and one way navigation

* Testcasefix

* Update consolas client

* fix bugs

* remove unnecessary func

* update service-2

* Missingheaderconsolas.ts

* fix weird code

alpha  build

refactor

debugging typeahead

debug misc UI bug; typeahead

no concurrent auto t

fix typeahead bug

fix test cases

fix max result bug

remove max Result for ListReco

Merge code scan command to basicCommands

fix OT webview display empty reco bug

gamma endpoint

fix cfg bug

fix bug of cursor position after format

clean up

in fixing unit tests

fix unit test

update alpha/gamma endpoint

no CG in C9

prod endpoint

fix(util): update AsyncCollection with better types aws#2657

fix(stepFunctions): bump amazon-states-language-service dependency to ^1.7.2 (aws#2660)

* Bump amazon-states-language-service dependency to ^1.7.2
* Add changelog entry
fix(git): prevent users from passing additional flags to ls-remote (aws#2661)

before:
error: unknown option `test'

after:
fatal: strange pathname '--test' blocked
fix(cdk): address more C9 edge-cases aws#2662

feat(runtimes): nodejs16.x aws#2628

Merge branch 'feature/vector' into autoMerge/feature/vector
Merge pull request aws#461 from aws/autoMerge/feature/vector

Merge staging into feature/vector
Merge branch 'feature/vector' into pentesting_fixes
try fix unit test bug in cloud

Merge branch 'pentesting_fixes' of github.com:leigaol/aws-toolkit-vscode-staging into pentesting_fixes

fix perf not found bug in unit test

feat: add optout support

fix: add resume icon

add performance in recHandler

resolve conflict

fix: fix input value when re-enter

Fix standalone python file use case

fix(performance): Explicitly include items in the vsix aws#2669

closes aws#1899
Merge staging into feature/vector

Merge branch 'feature/vector' into pentesting_fixes
Skip build/ symbolic link for python project

Telemetry pagination (#4)

* Adding Pagination Telemetry changes

* pagination SuggestionIndex change

* Paginationprogress change
fix weird code

alpha  build

no concurrent auto t

fix typeahead bug

fix test cases

fix max result bug

remove max Result for ListReco

Merge code scan command to basicCommands

fix OT webview display empty reco bug

update alpha/gamma endpoint

no CG in C9

fix(util): update AsyncCollection with better types aws#2657

fix(stepFunctions): bump amazon-states-language-service dependency to ^1.7.2 (aws#2660)

* Bump amazon-states-language-service dependency to ^1.7.2
* Add changelog entry
fix(git): prevent users from passing additional flags to ls-remote (aws#2661)

before:
error: unknown option `test'

after:
fatal: strange pathname '--test' blocked
fix(cdk): address more C9 edge-cases aws#2662

feat(runtimes): nodejs16.x aws#2628

Merge branch 'feature/vector' into autoMerge/feature/vector
Merge pull request aws#461 from aws/autoMerge/feature/vector

Merge staging into feature/vector
prod endpoint

Merge branch 'feature/vector' into pentesting_fixes
try fix unit test bug in cloud

Merge branch 'pentesting_fixes' of github.com:leigaol/aws-toolkit-vscode-staging into pentesting_fixes

fix perf not found bug in unit test

fix: add resume icon

add performance in recHandler

resolve conflict

fix: fix input value when re-enter

Fix standalone python file use case

fix(performance): Explicitly include items in the vsix aws#2669

closes aws#1899
Merge staging into feature/vector

Merge branch 'feature/vector' into pentesting_fixes
Skip build/ symbolic link for python project

Telemetry pagination (#4)

* Adding Pagination Telemetry changes

* pagination SuggestionIndex change

* Paginationprogress change

Merge branch 'feature/vector' into pentesting_fixes
Remvoe security scan panel from C9

Merge branch 'pentesting_fixes' of https://github.com/leigaol/aws-toolkit-vscode-staging into pentesting_fixes

BugFix: mark Accept undo/redo stack as false

Merge pull request #5 from leigaol/acceptRecomm_fix

BugFix: mark Accept undo/redo stack as false
Merge branch 'pentesting_fixes' into feat/optout
Merge pull request #6 from zixlin7/feat/optout

feat: add optout support
Merge branch 'pentesting_fixes' of https://github.com/leigaol/aws-toolkit-vscode-staging into pentesting_fixes

ConsolasTracker Exception fix

* maxReco=1 for C9

Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
Co-authored-by: Zoe Lin <zoelin@amazon.com>
Co-authored-by: Wade Fang <90796612+fangwade007@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Prateek Chauhan <prateekchauhan091@gmail.com>
Co-authored-by: Meghana Gunuganti <gmeghrao@amazon.com>
Co-authored-by: gmeghrao <92111456+gmeghrao@users.noreply.github.com>
Co-authored-by: Prateek Chauhan <48580344+prateekch91@users.noreply.github.com>
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.

3 participants