readrops / Readrops

Android multi-services RSS client
GNU General Public License v3.0
272 stars 20 forks source link

SyncWorker executed multiple times simultaneously #99

Open shunf4 opened 3 years ago

shunf4 commented 3 years ago

I have been investigating #93 by adding logging to these places:

https://github.com/readrops/Readrops/blob/d6f98b0d085f92852cc07988b5d6771abdff858d/app/src/main/java/com/readrops/app/repositories/FreshRSSRepository.java#L199 https://github.com/readrops/Readrops/blob/d6f98b0d085f92852cc07988b5d6771abdff858d/db/src/main/java/com/readrops/db/dao/FeedDao.java#L129 https://github.com/readrops/Readrops/blob/d6f98b0d085f92852cc07988b5d6771abdff858d/app/src/main/java/com/readrops/app/repositories/ARepository.java#L52

Also I redirected the logs to files on disk.

On Jan 14 the "deleted feeds" problem described in #93 occurred. Looking at the log files I was amazed to find SyncWorker executed three times simultaneously; multiple accounts in different executions (in different threads) interleaved, so "bad credentials - bad response - deleted feeds" story happened again.

Logs: log.log

Is this possible when you used WorkManager related APIs correctly?