Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New, cleaner, coroutine-based client implementation #52

Merged
merged 19 commits into from
Nov 14, 2023
Merged

Conversation

MrApplejuice
Copy link
Collaborator

@MrApplejuice MrApplejuice commented Oct 28, 2023

Started work on a new babybuddy-api client leveraging retrofit and jackson for automated data binding!

The new client uses generics-based query functions to directly query data types via the client in coroutine functions. This makes it a lot easier to configure and support new data bindings for which, up until now, I had to hand-spin the serializers and deserializers.

A huge milestone that will be reached after this is done, is that the timeline will support showing all current events and measurements/what-have-you that are supported in baby buddy. Not editing, just showing!

Current state

  • All events/activities are bound
  • Refactoring the old ChildEventHistoryLoader to use the new v2client
    • Broken! History does not auto-update right now
    • Broken! Exception handling for getEntries. Reveals a deeper problem: How to implement exponential backoff and the "spinning waiter" now?
  • TimelineObserver can be removed!
  • *Broken! Not filtering events by child - all events are shown now (lol!)
  • Fix slight bug where observers are not cleaned up correctly after booting the app and switching from child=1 to child=2 for example. After the initial load, everything works fine though. Probably related to the ViewPager-life cycle.
    • Cannot reproduce...
  • Check lifetime of queued coroutine calls!
  • Add new API-backend calls to DEBUG-interface

@MrApplejuice MrApplejuice marked this pull request as ready for review November 13, 2023 23:43
@MrApplejuice MrApplejuice merged commit 9d78851 into master Nov 14, 2023
@MrApplejuice MrApplejuice deleted the v2client branch November 14, 2023 22:52
@MrApplejuice MrApplejuice added the enhancement New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant