Harden codebase correctness and efficiency - #24
Merged
Conversation
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.
Summary
This is a focused codebase hardening pass based on the senior engineering audit. It fixes concrete correctness drift first, then applies measured efficiency and maintainability improvements without adding dependencies or changing the IndexedDB table schema.
What changed
monthas a primary key.entryToSignedAmount.computeMemberBalances.getOrCreate(personId, currency)transactional so concurrent callers cannot create two active ledgers for the same pair.personId/ compound indexes;expenseIdindex withanyOf()instead of loading entire relation tables;useMemorather thanuseLiveQuerywhen no database read occurs;monthindex.defaultCurrencyto backups while preserving device-only UI preferences on restore.lazyRouteComponent()API.SpinnertoSpinner.tsx; keepTabs.tsxas a tiny compatibility re-export and correct the UI barrel export.Regression coverage
Compatibility / data model
Validation
The new PR CI workflow is included in this branch and will run
pnpm typecheck,pnpm lint,pnpm test, andpnpm build. I will not merge until those checks are green.