Feat/auto-upload - #3
Merged
Merged
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
Contributor
There was a problem hiding this comment.
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 |
Arc891
commented
Jul 24, 2025
Arc891
commented
Jul 24, 2025
Arc891
commented
Jul 24, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
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