Developing Views, APIs, and Integrating SignalR

Last week, I had three primary objectives to accomplish before the week’s end. Firstly, I aimed to develop the view and view model for showcasing the latest table, alongside creating the necessary API for both command and query functionalities to be utilized by the report module. Following Mr. Peter’s recommendation, I also integrated SignalR into the API command to facilitate a progress bar, ensuring users are informed about ongoing processes. Given that this command involved calling upon 10 services, Mr. Peter advised sequencing them meticulously to avoid conflicts during implementation.

Once the foundation for the view and view model was laid, I delved into creating the API command, incorporating SignalR. Initially, I tested the functionality with just one service to ensure smooth execution before scaling it up to encompass all 10 services. Integrating SignalR necessitated adjustments to the service’s return states. With the necessary SignalR setup in place, I proceeded to conduct the controller test. Although the initial test was unsuccessful, I was able to identify the missing configurations causing the failures.

With the API command completed, I promptly integrated it into the UI. However, I soon realized the need for two separate API queries to retrieve data from the latest tables. Without wasting time, I dived into the creation of the two api query along with their tests. After confirming the success of the tests I devised, I refocused on optimizing the UI for seamless functionality. Approaching the end of the week, a significant challenge remained: devising a method to consolidate progress updates from all 10 services into a single progress indicator. This will be the first thing that I will work on this upcoming week.

Testing and Migration Updates

18.3.2024 – Last week, I focused on refining the progress of the previous week’s report. Ensuring code cleanliness and passing all tests became the priority. To start, I addressed the omission of temporary data that should have been included as input for the new report’s table. This was achieved by creating the required services. Subsequently, I proceeded to conduct tests for this implementation. However, a challenge arose when these tests only passed when executed separately. They failed when run collectively. Seeking guidance, I consulted Mr. Peter, who suggested two approaches: testing the services separately or using IFixture to run all tests together. Initially opting for the latter for test consolidation, I encountered an error when attempting to implement a file from the context API due to circular dependencies. Consequently, Mr. Peter recommended creating separate tests for each scenario to facilitate future debugging.

Additionally, there was a service test that persistently failed despite successful data validation, specifically in failing to change one particular boolean property to true. Upon investigation, I realized this was due to an oversight I made when using the AsNoTracking() function within the Get() function, which prevented any changes from being applied. As a result, the boolean property failed to reflect the intended modifications. At the week’s end, I completed a new migration for the latest updates across several databases and generated the migration SQL script.