1. 02 Feb, 2026 19 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Fix the worls · 2ac33806
      Stefy Lanza (nextime / spora ) authored
      2ac33806
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Include extraction stats for all matches with bets in incremental sync · cc5955e6
      Stefy Lanza (nextime / spora ) authored
      - When sending incremental report sync updates, extraction_stats array was empty
      - This happened because extraction stats were only included if they were new/updated
      - But when new bets are placed on matches with existing extraction stats, those stats weren't included
      - Now extraction stats are included for ALL matches referenced by bets being synced
      - This ensures server receives match information for all matches that have bets placed
      - Matches without extraction stats (not completed) get minimal entries with default values
      cc5955e6
    • Stefy Lanza (nextime / spora )'s avatar
      Add matches to incremental report sync payload · 8b3213e5
      Stefy Lanza (nextime / spora ) authored
      - Collect unique match IDs from bets being synced
      - Query and include match data for all matches referenced by bets
      - Add 'matches' array to report sync payload with full match details
      - Fixes issue where extraction_stats was empty and matches were not sent with bets
      8b3213e5
    • Stefy Lanza (nextime / spora )'s avatar
      Fix payout calculation in reports daily summary · 7039ed6d
      Stefy Lanza (nextime / spora ) authored
      - Changed payout calculation from ExtractionStatsModel.total_redistributed to sum of winning bet win_amount
      - Now correctly calculates payout by summing win_amount for all winning bet details in the selected timeframe
      - Uses is_bet_detail_winning() function to determine winning bets
      - Fixes issue where payout showed 0 instead of actual winning amounts
      7039ed6d
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Add match_number to extraction_stats in incremental reports sync · b21f3919
      Stefy Lanza (nextime / spora ) authored
      - Added match_number field to extraction stats data sent during incremental sync
      - This allows proper correlation of extraction stats with match results on server side
      - Fixes issue where extractions_stats field had no relative matches with results
      b21f3919
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Eagerly load bet_details to fix total_payout calculation · c8ed55c0
      Stefy Lanza (nextime / spora ) authored
      - Add joinedload for bet_details relationship when querying bets
      - This ensures bet_details are loaded for ALL bets, not just synced ones
      - Fixes total_payout showing 0 when there are winning bets
      - Summary is calculated from ALL bets (synced and not synced) as required for server reports
      c8ed55c0
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Use correct enum value 'win' instead of 'won' for bet result · 2ee7f304
      Stefy Lanza (nextime / spora ) authored
      - Fix _calculate_summary() to check for result == 'win' (correct enum value)
      - Previously checked for result == 'won' which doesn't exist in BetResult enum
      - Add safety check for bet_details to handle lazy loading
      - Fixes total payout showing 0 when there are winning bets
      2ee7f304
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Calculate summary from ALL bets and stats, not just synced ones · 38b8162c
      Stefy Lanza (nextime / spora ) authored
      - Pass 'bets' and 'stats' (all items in date range) to _calculate_summary()
      - Previously passed 'bets_to_sync' and 'stats_to_sync' (only new/changed items)
      - Summary now correctly reflects total payin, payout, and net profit for entire date range
      - Fixes net payout showing 0 when only incremental data is being synced
      38b8162c
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Calculate total_payout from actual win amounts instead of redistributed amounts · cdc46597
      Stefy Lanza (nextime / spora ) authored
      - Fix _calculate_summary() to sum win_amount from bet details where result is 'won'
      - Previously used total_redistributed which is amount redistributed to players, not payout to winners
      - This fixes total_payout showing as 0 when there are winning bets
      - Net profit calculation now works correctly
      cdc46597
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Add missing return statement in needs_recovery for normal case · 501e171f
      Stefy Lanza (nextime / spora ) authored
      - Add complete logic for checking timestamp mismatch
      - Ensure all code paths return tuple (needs_recovery, is_full_resync)
      - Fixes 'cannot unpack non-iterable bool object' error
      501e171f
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Only include client_id in report data when rustdesk_id is configured · 72703ef9
      Stefy Lanza (nextime / spora ) authored
      - Check if rustdesk_id is configured before including client_id in report data
      - Use rustdesk_id value as client_id when configured
      - Set client_id to None if rustdesk_id is not set
      - Prevents sending machine-generated client_id when rustdesk_id is not configured
      72703ef9
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Prevent recovery when full resync is needed · 30cef1b5
      Stefy Lanza (nextime / spora ) authored
      - Modify needs_recovery() to return tuple (needs_recovery, is_full_resync)
      - Skip recover_local_tracking() when full resync is needed
      - This prevents creating new sync tracking record that would cause incremental sync
      - Ensures full sync is actually performed when server requests it
      30cef1b5
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Only send client_id parameter when rustdesk_id is configured · af8200da
      Stefy Lanza (nextime / spora ) authored
      - Check if rustdesk_id is configured before sending client_id parameter
      - Use rustdesk_id value as client_id when configured
      - Do not send client_id parameter if rustdesk_id is not set
      - Fixes 400 error when server requires client_id only when configured
      af8200da
    • Stefy Lanza (nextime / spora )'s avatar
      Fix: Ensure client_id parameter is always sent in query_server_last_sync request · 3ec9beb1
      Stefy Lanza (nextime / spora ) authored
      - Make client_id parameter optional in query_server_last_sync()
      - Auto-generate client_id if not provided using _get_client_id()
      - Add debug logging for client_id parameter
      - Fixes 400 error when server requires client_id parameter
      3ec9beb1
    • Stefy Lanza (nextime / spora )'s avatar
      Implement full resync functionality for reports sync · 3836cd4a
      Stefy Lanza (nextime / spora ) authored
      - Add detection of server full resync indication (needs_full_resync flag or null last_sync_id)
      - Add _clear_local_tracking() method to force full sync
      - Modify needs_recovery() to check for full resync conditions
      - Modify collect_report_data() to force full sync when needed
      - Add comprehensive test suite for full resync scenarios
      - Add implementation documentation
      
      Handles cases where server indicates full resync is needed:
      - Server responds with needs_full_resync=true
      - Server responds with null last_sync_id
      - Server returns 404 (no record for client)
      3836cd4a
    • Stefy Lanza (nextime / spora )'s avatar
      Add cap_percent field to track CAP percentage at match completion · 21d05493
      Stefy Lanza (nextime / spora ) authored
      - Add cap_percent field to MatchModel database schema (default: 70.0)
      - Save cap_percent when match completes in games_thread.py
      - Include cap_percent in reports sync request payload
      - Add Migration_041_AddCapPercentToMatches for database migration
      
      This ensures historical tracking of the CAP percentage configured at the moment each match ends, allowing for accurate analysis and reporting.
      21d05493
    • Stefy Lanza (nextime / spora )'s avatar
      Bump version to 1.0.13 and update user agent to 1.0r13 · 9cbf87d3
      Stefy Lanza (nextime / spora ) authored
      - Update version from 1.0.12 to 1.0.13 in main.py, build.py, mbetterclient/web_dashboard/app.py, mbetterclient/config/settings.py, mbetterclient/__init__.py
      - Update user agent from 1.0r12 to 1.0r13 in mbetterclient/api_client/client.py and test_reports_sync_fix.py
      - Add time filtering feature to reports page with start/end time controls
      - Update daily-summary, match-reports, and download-excel API endpoints to support time filtering
      - Update CHANGELOG.md with version 1.0.13 entry
      9cbf87d3
    • Stefy Lanza (nextime / spora )'s avatar
      Bump version from 1.0.12 to 1.0.13 · 85de73e2
      Stefy Lanza (nextime / spora ) authored
      - Updated version strings in main.py, build.py, mbetterclient/__init__.py, mbetterclient/web_dashboard/app.py
      - Updated user agent from MbetterClient/1.0r12 to MbetterClient/1.0r13 in mbetterclient/config/settings.py
      - Updated user agent in test_reports_sync_fix.py
      - Added changelog entry for version 1.0.13
      85de73e2
    • Stefy Lanza (nextime / spora )'s avatar
      Implement client-side last sync query and accumulated shortfall tracking · bf87924a
      Stefy Lanza (nextime / spora ) authored
      - Add accumulated_shortfall field to MatchModel to store historical shortfall at match completion
      - Create Migration_040_AddAccumulatedShortfallToMatches for database schema update
      - Update extraction flow in games_thread.py to store accumulated shortfall in match records
      - Update sync report logic in client.py to use match's stored accumulated shortfall value
      - Add test_last_sync_query.py to verify implementation
      - Add CLIENT_SYNC_MINIMAL_PROMPT.md with API specifications
      
      This ensures accurate reporting of cap compensation balance as it existed at the time each match was completed, rather than using the current global value.
      bf87924a
  2. 01 Feb, 2026 2 commits
    • Stefy Lanza (nextime / spora )'s avatar
      Implement database-based queue for reports synchronization · eef784ce
      Stefy Lanza (nextime / spora ) authored
      - Add ReportsSyncQueueModel database model for persistent sync queue storage
      - Update ReportsSyncResponseHandler to use database instead of JSON files
      - Add transaction safety with rollback support for queue operations
      - Implement automatic cleanup of completed items
      - Add database indexes for efficient querying
      - Create comprehensive test suite for database-based queue (test_reports_sync_db.py)
      - Update documentation to reflect database implementation
      
      This change improves performance, data integrity, and scalability of the
      reports synchronization feature by migrating from JSON file storage to SQLite database.
      eef784ce
    • Stefy Lanza (nextime / spora )'s avatar
  3. 28 Jan, 2026 1 commit
  4. 27 Jan, 2026 3 commits
  5. 23 Jan, 2026 3 commits
  6. 20 Jan, 2026 4 commits
  7. 18 Jan, 2026 5 commits
  8. 14 Jan, 2026 1 commit
  9. 06 Jan, 2026 1 commit
  10. 02 Jan, 2026 1 commit