# <span style="color:yellow; background-color:black">Yellow</span> Squad Tech Debt Findings
### The goal of the <span style="color:yellow; background-color:black">Yellow</span> squad is to improve the App **performance** and **stability**.
### Tickets:
Single Source Of Truth
https://jira.dcsg.com/browse/CMT-6740
Generic Caching mechanism to handle our current services
https://jira.dcsg.com/browse/CMT-6741
Data / Caching policy
https://jira.dcsg.com/browse/CMT-6742
Data Layer
https://jira.dcsg.com/browse/CMT-6743
Analisys
https://jira.dcsg.com/browse/CMT-6744
Minimize leaks
https://jira.dcsg.com/browse/CMT-6745
Check for SwiftUI, Concurrency issues, Animation Hitches
https://jira.dcsg.com/browse/CMT-6746
Revise the logic of the bottom tab view (Custom Tab)
https://jira.dcsg.com/browse/CMT-6762
Product detail view refactoring
https://jira.dcsg.com/browse/CMT-6718
Payment revisit
https://jira.dcsg.com/browse/CMT-6719 (SPIKE ticket)
Investigate about using "swipeActions" in Cart Item
https://jira.dcsg.com/browse/CMT-6560
Investigate about using .badge() for Cart Tab item in iOS 15
https://jira.dcsg.com/browse/CMT-6574
Remove CartNCheckout dependency from Shop module for PayPal & ApplePay
https://jira.dcsg.com/browse/CMT-6229
Common method to add getAuthorizationToken() value to request header
https://jira.dcsg.com/browse/CMT-6764
Use StoreModeNavBarItems across the app
https://jira.dcsg.com/browse/CMT-6765
Create Navigation Title View Component
https://jira.dcsg.com/browse/CMT-6767
Use LoadingIndicator component across the app
https://jira.dcsg.com/browse/CMT-6768
#
### 1. Single Source Of Truth
We need to aggregate the data from many api calls performed on different views / modules within the App to a single location.
We will get:
- syncronized data
- simple data access
- simple caching implementation
#
### 2. Generic Caching mechanism to handle our current services
Having a single source of truth it's simple to implement a generic caching mechanism which can manage data in the actual state
We will get:
- one implementation for all or most of our current services
- individual management with data / caching policy
- significantly reduced network load
- reduced battery usage
#
### 3. Data / Caching policy
Implementing Caching mechanism we need to design a Data / Caching policy which can be applied to any of our cached service.
We will get:
- control on data updating flow
- automatic data refresh
- significant improvement in App performance / UX
#
### 4. Data Layer
We need to make sure our data is accessible at any point inside the App
We will get:
- Less errors during refactoring code every time to get data accessible in certain part of the APP
- Centralized control of data flow
- Significantly improve reliability of data state
- Our code will become much nicer to work with :)
#
### 5. Analisys
Xcode helps us to find weak spots with purple warnings and instruments. We know that purple warning is a potential issue (crash, UI, State). Moving to Xcode 14.x and iOS 16.x we have a lot of such warnings now.
The goal is to analyze and provide a possible fix description to concider the right action.
We will get:
- Acknowledgment of possible critical issues to focus on with high priority
- Possible quick fixes of minor issues
- Understanding of ammount of time we need to fix all warnings
#
### 6. Minimize leaks
Currently we have a significant ammount of leaks in the App. Some of them are easy to fix, som of them need more attention. We need use instruments provided with Xcode to findout the leaks and their causes.
We will get:
- A significant improvement in the overall well-being of the application and team
- Decreasing device resources required for the App (memory, energy)
- Improvement in performance and stability
#
### 7. Check for SwiftUI, Concurrency issues, Animation Hitches
All this staff is good to do from time to time as a yearly physical. Using Instruments provideng by Xcode check code for issues, easy to fix things should be fixed other reported for a consideration.
We will get:
- Possible quick fixes for minor issues
- Understanding of the situation about possible problems
- Possible improvement in UI
- Possible improvement in data race scenarios
#
### 8. Revise the logic of the bottom tab view (Custom Tab)
Investigate the logic of bottom tab bar,
1. check if we can use .badge modifier instead of creating badge overlays (where we have ui problems sometimes). Provide alternative solution if possible.
2. check and refactor if possible CustomTab logic (view + view model). Currently it looks overcomplicated and we have inconsistent crash related to custom tab implementation. Provide alternative code.
3. investigate AccountNavigationCoordinator if we can do that logic without AnyView. Provide possible solution.
<!-- 1 CartViewModel
* While investigating the issue with paypalOnAddedToCartEnabled and applepayOnAddedToCartEnabled
feature flags I noticed some logic is not working correctly and in addition there are Xcode purple warnings. When these feature flags are on the progress spinner spins infinetelly on adding item to cart.
I assume we can observe unexpected behavior in certain scenarios.

* The way of declaring view models as @Published properties does not seem correct:

-->