feat(family): add Family and FamilyMember local tables - #530
Open
plusmobileapps wants to merge 1 commit into
Open
feat(family): add Family and FamilyMember local tables#530plusmobileapps wants to merge 1 commit into
plusmobileapps wants to merge 1 commit into
Conversation
Local cache for the families/family_members tables added in the previous commit. Nothing consumes the queries yet — the repository that does lands next. Deliberately not offline-first: unlike GroceryList and RecipeBook these carry no clientId / isDirty / getUnsynced columns. Membership is inherently a server concept — creating a family offline could collide with an invite accepted on another device, and the one-family-per-user rule can only be arbitrated by the database. So these are read caches refreshed from the server, which is also how RecipeBookCollaborationRepository treats collaboration state. Members are cached locally (grocery's model) rather than fetched per-view (recipe books' model) so the Family screen can expose an observable Flow and render offline. Schema goes to version 12; verifyCommonMainDatabaseMigration passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 2/3 — stacked on #529. Review that one first; this diff shows only the SQLDelight changes once #529 is merged.
What
The local cache for the
families/family_memberstables added in #529, plus their DI bindings. Nothing consumes the queries yet — the repository that does is in stack 3/3.Why these aren't offline-first
Unlike
GroceryListandRecipeBook, these carry noclientId/isDirty/getUnsyncedcolumns. That's deliberate, and it's the main thing to push back on if you disagree.Membership is inherently a server concept. Creating a family offline could collide with an invite accepted on another device, and the one-family-per-user rule can only be arbitrated by the database. So these are read caches refreshed from the server, and writes (in stack 3/3) go remote-first and throw — the same treatment
RecipeBookCollaborationRepositorygives collaboration state.Members are cached locally (grocery's model) rather than fetched per-view (recipe books' model), so the Family screen can expose an observable
Flowand render offline. That's the one place the two existing implementations diverge, and grocery's is the better shape.Schema
Goes to version 12.
verifyCommonMainDatabaseMigrationpasses, and12.dbis regenerated rather than hand-edited.FamilyMember.isOwnerexists because the owner's row is synthesized server-side by thefamily_members_with_profilesRPC and arrives with a nullremoteId—rolealone can't distinguish them.🤖 Generated with Claude Code