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
[NTV-636] Regression: Crash when logging out of creator account and switching tabs 5.6.0 #1761
Merged
Conversation
This file contains 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
Codecov Report
@@ Coverage Diff @@
## main #1761 +/- ##
=======================================
Coverage 85.42% 85.42%
=======================================
Files 1273 1273
Lines 116207 116209 +2
Branches 30635 30637 +2
=======================================
+ Hits 99273 99275 +2
Misses 15867 15867
Partials 1067 1067
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
scottkicks
changed the title
Ntv 636
[NTV-636] Regression: Crash when logging out of creator account and switching tabs 5.6.0
Dec 6, 2022
…dex 0 if this scenario arises
scottkicks
added a commit
that referenced
this pull request
Dec 6, 2022
* [PAY-2055] Project Currency Country Code Display Error (#1754) * added a project currency, oddly build is crashing when opening a project, but unrelated to any new code. * removed extaneous currency field from top level project and used existing stats field. * fixed incorrect parameter build issue * fixed extra parameter in lenses * removed unused line * corrected display issues for rewards and reward addons. * reverting spacing in ProjectLenses, unneeded change, cluttering pr * more ProjectLenses updated * bonus support currency fix on pledge page. * updated a shared function of min max pledge amount to use the project's currency country instead of project country. * updated Apple Pay request currency code to be from project currency first, then project country currency. Also updated the supported networks of apple pay to be based on project currency country instead of project country * updated analytics to come from the project currency country not project country * updated summary view, apple pay alert, and expandable rewards header (spacing) to use project currency country first then project country * total values for pledge summary view using project currency country before project country * handled logged currency display scenarios (manage pledge flow) * formatting * fixed currency issue when user logged in and about to manage pledge, fetch backing doesn't update the chosen currency in the project. * added view model tests * more view model tests * project summary view model tests * pledge view model and project page view model tests * project page snapshot tests added, existing project lense hadn't accounted for extended project properties, now it does. * pr comments. * [WEB-666] - Require FB Only Users To Set A Password (#1755) * adds bool to user model * separate apple and facebook signals to gain more control over facebook flow in LoginToutViewController * Push SetYourPasswordViewController if fb user needs a password * Run make strings script to pull in latest string updates from server * fetch user's email and set context label * create new password on user account and handle success and error cases * make strings * change nav bar back button text * update unit tests * wrap in fb login depreciated feature flag * update view model tests * adds activity indicator * update strings * add tests * format * update failing snapshot tests * needsPassword is not actually an optional * use kickstarter conventions * updates uses of now non nil needsPassword property * move loading indicator from top level view to stackview and replace save button when loading indicator is showing * update snapshot tests * update comments * update snapshot tests * update saveButton isHidden/isEnabled * Remove unused User+GraphUser.swift * Update User+UserFragment.swift * Removes User+UserGraph releated tests * Update LoginToutViewModelTests * Update SetYourPasswordViewModelTests * formatting * Refactor needsPassword static func * put back User+GraphUser because more test files than expected use it * Revert "Removes User+UserGraph releated tests" This reverts commit 2026508. * corrected the api and library tests, was able to remove unused User+GraphUser and tests. Snapshot tests still failing. * updated snapshot tests, all kickstarter-ios tests recorded and passing on intel. Should pass CI checks. * revoked a change just being used for testing. * rerecorded tests due to translation changes * more re-records on Intel because of translations * updated set your view model tests Co-authored-by: Mubarak Sadoon <msadoon@gmail.com> * [Unticketed] user needs_password not returned in v1/discover/ creator (#1758) * needs password needs to be optional. * add a default property for encoding * [PAY-2053] Add New Payment Button Padding FIx (#1759) * added constraints to add new button and loading indicator view to constraint them to the edges of their stack view and center them. One is only shown at a time, so the spacing error should not occur anymore. * slight adjustment in the add button and loading indicator positions. * updates to pledge view controller screenshot tests. * guard against index out of range issue and default selected tab to index 0 if this scenario arises (#1761) Co-authored-by: Mubarak Sadoon <msadoon@gmail.com>
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.
📲 What
A crash was found during 5.6.0 regression testing when switching tabs after logging and then out of a creator account. More info here
🤔 Why
This is an index out of range crash when selecting a new tab.
When a creator logs out our RootTabBar immediately updates its tabs/indices. There is a bit of a race condition where the RootViewModel attempts to set athe
prevSelectedTabBarItem
property before it recognizes that the user is no longer a signed in creator. Since creators see 1 more tab than logged out or backers (5 in total), the last selected item is technically out of range.🛠 How
Added
guard index < data.items.count else { return tabBarItemLabel(for: data.items[0]) }
to
prevSelectedTabBarItem
's signal chain to protect against this race condition.So if this happens we’ll programmatically select the first tab, “Explore”, by default which is what we want anyway.
✅ Acceptance criteria