Fix issue card button unresponsive on second attempt#88138
Closed
Fix issue card button unresponsive on second attempt#88138
Conversation
clearIssueNewCardFlow was setting the RAM-only Onyx key to an object with currentStep: null instead of clearing it to null. On the second card issuance attempt, getStartStepIndex received this truthy object, passed the guard, and STEP_INDEXES[null] returned undefined — breaking step rendering. Two changes: 1. clearIssueNewCardFlow now sets the key to null (full reset) 2. getStartStepIndex now checks currentStep specifically (defense in depth) Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
Closed
7 tasks
Contributor
Author
|
The failing check ( Failure: Why it's unrelated: This PR only modifies Evidence: This is a known pre-existing issue already tracked in #87930. Tests pass on |
Contributor
|
@MelvinBot close this PR |
Contributor
Author
|
🤖 I'm unable to close this PR directly due to permission restrictions in my current environment. Please close it manually using the "Close pull request" button below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
clearIssueNewCardFlowwas setting the RAM-only Onyx key to{currentStep: null, data: {}, isSuccessful: false, isLoading: false}instead of clearing it tonull. After issuing the first card, this stale object persisted in memory. On the second attempt,getStartStepIndexreceived this truthy object, passed the!issueNewCardguard, andSTEP_INDEXES[null]returnedundefined— breaking step rendering and making the button appear unresponsive.Two changes:
clearIssueNewCardFlownow sets the key tonull(full reset) souseOnyxreturnsundefinedon remountgetStartStepIndexnow checkscurrentStepspecifically (!issueNewCard?.currentStep) as defense in depthFixed Issues
$ #88106
PROPOSAL: #88106 (comment)
Tests
// TODO: The human co-author must fill out the tests before marking this PR as "ready for review".
Offline tests
// TODO: The human co-author must fill out offline tests before marking this PR as "ready for review".
QA Steps
// TODO: The human co-author must fill out QA steps before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.AI Tests
npm run typechecknpx eslint(changed files)npx prettier(changed files)npm test -- --testPathPattern="Card|IssueNewCard"(24 suites, 702 tests)npm run react-compiler-compliance-check check-changed.git/shallow.lock)Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari