Closed Cuyer closed 12 months ago
I assume it's Dagger's fault because the DataStore and SharedPreferences write the data correctly, but the DataStore can't read it fast enough. DataStore is a relatively new library, so maybe this isn't handled correctly.
Can you provide more details about why you think this is an issue in the Dagger library? The Dagger library itself doesn't know anything about DataStore or SharedPreferences, so with the current information it's not clear how it's related. Fwiw, this sounds more like a StackOverflow kind of question.
Hi,
My problem is that when using DataStore, the data is saved correctly and updated correctly every time, but it is read incorrectly. ( I open applicationB from applicationA and I am passing data with intent) When I launch the application for the first time, I do not have access to the data I wanted to transfer. Only when the application is relaunched, the data is returned from the DataStore, but it is old data.
This problem does not occur when using SharedPreferences.
I assume it's Dagger's fault because the DataStore and SharedPreferences write the data correctly, but the DataStore can't read it fast enough. DataStore is a relatively new library, so maybe this isn't handled correctly.
I've tried to restrict the scope so I've added
@InstallIn(ViewModelComponent::class)
but it didn't work. I've tried fetching the data about ipAdress in Application() class, but it didn't work eitherBelow is my RetrofitModule in which I try to get ipAddress from DataStore:
DataStore Module: