Fix: Add full JSON response logging to /api/reports/last-sync

- Log the complete JSON response being sent back to the client
- This helps debug what the client is receiving
- Shows requires_full_sync flag and all response fields in formatted JSON
parent 2019b6df
...@@ -1517,7 +1517,7 @@ def api_get_last_sync(): ...@@ -1517,7 +1517,7 @@ def api_get_last_sync():
logger.info(f"API get last sync: Client {client_id} - NO sync records found, bets={total_bets_for_client}, stats={total_stats_for_client}, match_reports={total_match_reports_for_client}, requires_full_sync={requires_full_sync}") logger.info(f"API get last sync: Client {client_id} - NO sync records found, bets={total_bets_for_client}, stats={total_stats_for_client}, match_reports={total_match_reports_for_client}, requires_full_sync={requires_full_sync}")
return jsonify({ response_data = {
'success': True, 'success': True,
'message': 'No sync records found for this client', 'message': 'No sync records found for this client',
'client_id': client_id, 'client_id': client_id,
...@@ -1527,7 +1527,11 @@ def api_get_last_sync(): ...@@ -1527,7 +1527,11 @@ def api_get_last_sync():
'total_syncs': 0, 'total_syncs': 0,
'requires_full_sync': requires_full_sync, # Signal to client that full sync is needed 'requires_full_sync': requires_full_sync, # Signal to client that full sync is needed
'server_timestamp': datetime.utcnow().isoformat() 'server_timestamp': datetime.utcnow().isoformat()
}), 200 }
logger.info(f"API get last sync: Client {client_id} - Returning response: {json.dumps(response_data, indent=2)}")
return jsonify(response_data), 200
# Get total sync count for this client # Get total sync count for this client
total_syncs = ReportSync.query.filter_by(client_id=client_id).count() total_syncs = ReportSync.query.filter_by(client_id=client_id).count()
...@@ -1563,6 +1567,7 @@ def api_get_last_sync(): ...@@ -1563,6 +1567,7 @@ def api_get_last_sync():
} }
logger.info(f"API get last sync: Client {client_id} - Returning response with requires_full_sync=False (has sync records)") logger.info(f"API get last sync: Client {client_id} - Returning response with requires_full_sync=False (has sync records)")
logger.info(f"API get last sync: Client {client_id} - Full response: {json.dumps(response_data, indent=2)}")
# Add sync log details if available # Add sync log details if available
if last_sync_log: if last_sync_log:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment