Stuck in the Dependency Hell

This week, I was tasked with doing some test tasks, however, in order to complete them, I had to update a number of dependencies, which resulted in a large number of dependency conflicts.

My supervisor gave me the go-ahead to upgrade all dependencies and the react native version to the most recent version. It is not uncommon to discover several problems in the code and some dependency conflicts after getting done from the updates, which eventually I was able to resolve. Moreover, to modify the code and fix the errors, I had to spend some time reading the documentation for the new versions that I had upgraded.

Finally, with Mr. Peter’s assistance, the application ran properly on the emulator. Unfortunately, the testing dependencies still contain some errors, and Jest is unable to test the application. I have attempted a variety of solutions to resolve this issue, which will be resolved by next week.

In conclusion, this week was filled with dependencies updates and bug debugging. I’ve gained a lot of knowledge about how to handle the dependency conflict through much searching and reading, and from Mr. Peter of course. Now I must resolve the rest of the issues in the testing section so everything can be updated and work well.

Fix Overall Bug in Repository and View Model Class

First and foremost, I start the week by removing duplicate integrations tests. Then, fix failure tests on repository test class as all of it failed. It is fix by adding test_server config.xml file to map towards database. However, few tests on UOM (unit of measurement) failed. As the test class is testing actual database tests. Direct initialization is required to ensure function run throw the references, variable able to reach and store directed value.

Next, I have problem with state machine in the system. Upon deletion of selected data, the system would prompt error of state machine. State.DeleteTrigger() is not implemented to go to correct state next. Thus, the only way is to remove State.DeleteTrigger(). By removing State.DeleteTrigger(), the state machine would move from State.SelectedTrigger() to State.DeselectTrigger(), which is logical flow as mapped in State Machine class.

Repository class only handles database code which is CRUD command towards database. Thus, move business logic that wrongly implemented in repository class to Wrapper Service/View Model class. After moving those logic away from repository class, the code in repository is more tidy.

Last but not least, I find it weird that system does not prompt error under a concurrency situation when It suppose to. I ran through the system once and I found out problem occurs at my status checker from last week’s implementation. The value of _selectedStatus is set to SelectedStatus.Normal, which will constantly get latest data to update the list before I save any changes.

if (_selectedStatus == SelectedStatus.Normal)
{
_selectedStatus = SelectedStatus.Selected;
_eventAggregator.GetEvent().Publish(id); //Get Latest Data
}


Hence, database update is smooth as if there is no concurrency situation. But it will make user think they did not make any changes, if both before and after value appears to be the same. To solve this, I define _selectedStatus == SelectedStatus.Selected before I request to save changes upon editing selected data, so that it does not pass through get latest data event.