# Tech Debt Findings - Alex ### The goal of the <span style="color:yellow">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 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, Animation Hitches https://jira.dcsg.com/browse/CMT-6746 # ### 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 - cashing # ### 2. Generic Caching mechanism to handle our 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 porple warning is a potential issue (crash, UI, State). Moving to Xcode 14.x and iOS 16.x we have a lot of this wornings 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, 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 <!-- 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. ![](https://i.imgur.com/jEIT9lP.png) * The way of declaring view models as @Published properties does not seem correct: ![](https://i.imgur.com/ba4auN4.png) -->