Skip to content

Optimize Sync Reliability, Revamp Mobile Account Details, and Harden Deployment Scripts for v0.4.0#64

Merged
bingyangchen merged 15 commits into
mainfrom
optimize/0.4.0
Jun 14, 2026
Merged

Optimize Sync Reliability, Revamp Mobile Account Details, and Harden Deployment Scripts for v0.4.0#64
bingyangchen merged 15 commits into
mainfrom
optimize/0.4.0

Conversation

@bingyangchen

Copy link
Copy Markdown
Owner

Why

  • Sync Integrity & Conflict Resolution: Rigid unique constraints on Tag, Budget, and CategoryBudget tables caused sync failures and write collisions during concurrent client-server synchronization. Removing these constraints, introducing a 10-second sync safety buffer, and filtering by updated_at in local status updates prevent sync-related data loss.
  • Enhanced Account Analytics & UX: Replaces static mobile account detail layouts with a dynamic parallax scrolling header and a chronological asset-valuation line chart for securities accounts. Transitioning to safe softDelete preserving historical ledger data.
  • Harnessed Deployments & Migration Automation: Standardizes uppercase IMAGE_TAG environment variables across docker-compose files and workflows, integrates automatic Alembic migrations during production deployments, and hardens all bash scripts with strict error flags (set -euo pipefail).
  • Agent Alignment & Performance: Updates guidance and templates to establish higher standards of precision, conciseness, and performance (e.g., cached achievement statistics).

Made with Cursor

…y and functionality

- Removed the redundant token type check from the JWT payload in the `_create_access_token` method, streamlining the token creation process.
- Enhanced overall code clarity and maintainability in the authentication module.
…ferences in AccountDetailPage and CategoryFormSheet for clarity in soft deletion functionality.
… logic

- Replaced the `_onPullRefresh` method with a simplified `_onRefreshTriggered` method to enhance data loading efficiency.
- Improved the refresh indicator functionality by ensuring the UI updates correctly based on the unlocked achievements count.
- Cleaned up the layout structure in the achievement list page for better readability and maintainability.
- Updated achievement group titles for better localization and understanding.
- Introduced a new mapping for achievement IDs to streamline display order logic.
- Refactored achievement data processing to enhance filtering and sorting efficiency.
- Improved state management for achievements, including recent unlock tracking and next cards display.
- Cleaned up redundant code to enhance maintainability and readability.
…tDetailPage

- Added AccountBalanceChart and AccountSummaryHeader widgets to display account balance trends and summary information.
- Enhanced data handling to calculate total adjustments and maintain a history of daily balances.
- Updated AccountDetailPage layout to incorporate new widgets and improve user experience with a transparent app bar.
- Removed obsolete code related to market value updates for securities, streamlining the UI.
…DetailPage

- Introduced a displayName getter in the Account class to provide a unified way to retrieve account names.
- Refactored balance history calculations in AccountDetailPage to improve clarity and efficiency.
- Removed unnecessary total adjustments parameter from AccountSummaryHeader, simplifying the widget's interface.
- Updated the delete account confirmation logic to utilize the new displayName method for better user feedback.
…sion

- Updated the `_formatWithDigitLimit` function to use `replaceFirstMapped` for better handling of trailing zeros in formatted numbers, enhancing the accuracy of displayed values.
…nization

- Introduced a safety buffer in the pull method to prevent data loss by adjusting the last synced timestamp.
- Updated the return value of the pull method to use a sync anchor for better tracking of synchronization time.
… logic

- Modified the batch update method to include a check for the 'updated_at' timestamp, enhancing data integrity during synchronization.
- This change ensures that only the most recent records are marked as synced, preventing potential data discrepancies.
… to simplify database schema and enhance flexibility in data management.
…nt handling

- Updated image tag references in `compose.prod.yaml` and deployment scripts to use `IMAGE_TAG` instead of `image_tag`.
- Introduced a new `migrate-prod` target in the Makefile for database migrations during production deployment.
- Enhanced environment validation in scripts to ensure correct deployment context.
- Improved error handling and clarity in image build and pull processes.
- Added a new migration script to handle database upgrades in production.
@bingyangchen bingyangchen self-assigned this Jun 14, 2026
@bingyangchen bingyangchen requested a review from leechai-app June 14, 2026 10:34
- Introduced a new `test` target in the Makefile to facilitate running tests.
- Added a `test.sh` script to automate Flutter checks, including code formatting, static analysis, and running tests.
- Updated `pubspec.lock` with new package versions for improved dependencies.
- Refactored `journal_page.dart` to adjust alignment in the SizeTransition widget for better UI presentation.
@bingyangchen bingyangchen merged commit ec5d49c into main Jun 14, 2026
6 checks passed
@bingyangchen bingyangchen deleted the optimize/0.4.0 branch June 14, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants