-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/auto-upload #3
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
Conversation
- Replace /export command with automatic background uploads - Transactions now upload to Google Sheets immediately upon categorization - Remove /export command and related UI completely - Add robust row detection with safety checks to prevent overwrites - Enhanced error handling and debug logging for uploads
…oad queue Major refactoring to introduce comprehensive transaction caching and automatic Google Sheets upload: 🚀 Core Features: - **Background Upload Queue**: Immediate transaction uploads with rate limiting and safety checks - **Transaction Caching System**: "Cache for Later" feature with dummy uploads and row reservation - **Unified Session Management**: Single source of truth for all user state per session file - **Row Safety Checks**: Prevents data overwrites with collision detection and recovery 🔧 Infrastructure Changes: - Remove /export command and legacy manual export logic - Migrate from global sheet_positions.json to per-user session files - Add robust row detection with empty sheet validation and cached position verification - Implement immediate row reservation for cached transactions to prevent conflicts 🎯 User Experience: - New /cached command to view and process deferred transactions - Automatic transaction processing with smart categorization - All UI buttons disabled after use to prevent duplicate actions - Enhanced error handling and user feedback 🐛 Critical Fixes: - Fix cached transaction replacement using correct reserved rows instead of next available - Ensure cached transactions are immediately removed from session to prevent duplicates - Preserve _reserved_row field through entire replacement workflow - Enhanced logging for debugging cache and row operations 📁 File Changes: - background_upload.py: Complete rewrite with queue system and safety checks - session_management.py: Unified state management with caching support - transaction_prompt.py: Enhanced UI with caching workflow - cached_transactions_view.py: New dedicated UI for cached transaction management - bot_commands.py: Add /cached command, remove /export - constants.py: Add DUMMY_CACHED category for cache placeholders ✅ Tested and deployed successfully with Docker containerization
- Add GSHEET_NAME, GSHEET_TAB, and configurable starting rows to config - Move sheet configuration from constants.py to config_settings.py - Implement GSHEET_EXPENSE_START_ROW and GSHEET_INCOME_START_ROW support - Remove backup files and clean up debugging code - Fix typo: ABBONEMENTEN -> ABONNEMENTEN in expense categories - Update session management to use configurable defaults - Improve error handling in Google Sheets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive caching system for transaction categorization, allowing users to save transactions with dummy entries for later processing while maintaining their position in Google Sheets. Additionally, it adds configurable starting row positions for Google Sheets to support various sheet layouts.
- New caching system: Users can cache transactions for later processing with dummy entries
- Configurable sheet layout: Support for custom starting rows in Google Sheets through environment variables
- Background upload queue: Automatic transaction uploads with proper rate limiting and row position management
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| transaction_prompt.py | Adds cache button, cached transaction processing views, and auto-upload integration |
| cached_transactions_view.py | New UI components for managing cached transactions |
| session_management.py | Extended session data structure with caching and sheet position tracking |
| google_sheets.py | Updated to use configurable sheet names from config instead of constants |
| background_upload.py | New background queue system for automatic Google Sheets uploads with rate limiting |
| constants.py | Fixed typo (ABBONEMENTEN → ABONNEMENTEN) and moved sheet config to config_settings |
| config_settings.example.py | Added new configuration options for sheet layout and names |
| bot_commands.py | Replaced export command with cached command, updated to reflect auto-upload |
| bot.py | Added startup of background upload queue |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add Configurable Google Sheets Layout Support
Summary
This PR introduces configurable starting rows for Google Sheets transactions and cleans up the codebase by removing excessive debugging code that was added during troubleshooting.
Key Changes
Configuration
Users can now customize where transaction data starts in their sheets:
Impact