pusher / push-notifications-android

Android SDK for Pusher Beams
https://www.pusher.com/beams
MIT License
21 stars 22 forks source link

Persistent storage to use json #81

Closed daniellevass closed 5 years ago

daniellevass commented 5 years ago

I've updated the Persistent Storage Queue to use ObjectQueue instead of QueueFile which means we also need a converter as described here - https://github.com/square/tape#converter

We are using the Moshi implementation as that's also designed by Square and so work better together.

This means we've added two new libraries

I've also increased our test coverage to test each type of our Server Sync Jobs and updated the ones that originally wrote Strings to write a Server Sync Job type instead.

I've extracted the Server Sync Job types into their own file, and put the converter there so in future if we add any more Jobs, we only need to update them all in one place :-)

Finally, I've also converted our java syncronized() functions into kotlin @synchronized annotations

daniellevass commented 5 years ago

Just a note about the last commit - i had to comment out the test where we try to de-serialize an object that doesn't exist anymore. This is because we're now logging a warning, and because we're not mocking that logger or have a test logger it's failing at that part. I've commented it out and put a //todo to uncomment after we've refactored the logger. Does that make sense?