planetary-ios
planetary-ios copied to clipboard
Double post when publishing
Yesterday this happened to me:
- Composed a new post
- Tapped the "Post" button
- Planetary showed an error (SQLite Error 0) because the database was busy
- My post did not show up in the thread where I posted it
- I tapped "Post" again.
- Posting succeeded and my post showed up twice.
This is an unfortunate consequence of having two databases and SQLite just randomly failing queries sometimes if it is waiting too long for a lock. What happened under the hood was:
- When I hit post my post was published to go-ssb's Badger db
- Then Planetary asked go-ssb for the new post to write it to SQLite
- The write to SQLite failed because SQL was busy doing other things
- We show the error to the user, and they think the post has failed to publish, not just to display
Possible solutions are:
- retry the SQLite write a few times
- show an error message that let's the user know that the error is with displaying their post, but it did publish successfully
I ran in to this too. We should prevent you posting the exact same thing twice.
Add a block to go to prevent two exact same posts. Stop showing sqlite errors on insert because they are ok actually.
swift issue for sqlite error too.