levibostian / Wendy-Android

Build offline first Android mobile apps. Remove loading screens, perform tasks instantly.
https://levibostian.github.io/Wendy-Android/wendy/
MIT License
64 stars 16 forks source link

Remove `taskId` in `PersistedPendingTask`. #28

Closed levibostian closed 6 years ago

levibostian commented 6 years ago

I have id and taskId in PersistedPendingTask. I have taskId in PendingTask.

After working on Wendy-iOS as well as reading over my code, I do not see a reason to have taskId in PersistedPendingTask any longer.

In the iOS version of Wendy, I am using id in PersistedPendingTask which maps to PendingTask. In Wendy-Android, it seems the only reason that taskId exists is to give the user the ability to update their existing PendingTask in Wendy is they try to insert a PendingTask with the same tag and dataId as one that already exists in the sqlite DB.

I say that if a PendingTask already exists in the DB, do not update it. Log a big fat warning to the console for the developer to pay attention to and return the existing PendingTask they have already created before.

Maybe even make a strict mode in Wendy enabled by default where I throw an error if I try to insert a PendingTask that already has been added before.