Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 11, 2025

Summary

  • Added logging of x-tracking-id header from Tinkoff API responses in TraderBot
  • Modified PlaceBuyOrder, PlaceSellOrder, and CancelOrder methods to capture and log tracking IDs
  • Added example demonstrating tracking ID extraction for future reference

Implementation Details

The solution modifies the order handling methods to:

  1. Use using var call = InvestApi.Orders.PostOrderAsync(...) pattern to access response headers
  2. Extract x-tracking-id from response headers using headers.GetValue("x-tracking-id")
  3. Log the tracking ID with a clear message: "Tinkoff request tracking ID: {trackingId}"

Why This is Important

  • Tracking IDs are essential for efficient communication with Tinkoff technical support
  • When reporting issues to Tinkoff, providing the tracking ID speeds up incident resolution
  • Each API request receives a unique UUID tracking ID that helps support teams debug issues

Test Plan

  • Code compiles without errors
  • Build passes with existing warnings unchanged
  • Added example demonstrating tracking ID extraction pattern
  • Logging format is clear and consistent across all order methods

Files Changed

  • csharp/TraderBot/TradingService.cs: Added tracking ID logging to order methods
  • examples/TrackingIdExample.cs: Added example demonstrating the tracking ID pattern

🤖 Generated with Claude Code


Resolves #184

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #184
@konard konard self-assigned this Sep 11, 2025
konard and others added 2 commits September 11, 2025 13:08
- Modified PlaceBuyOrder to log x-tracking-id header from PostOrderAsync
- Modified PlaceSellOrder to log x-tracking-id header from PostOrderAsync
- Modified CancelOrder to log x-tracking-id header from CancelOrderAsync
- Added example demonstrating tracking ID extraction and logging
- Tracking IDs are essential for efficient communication with Tinkoff support

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Trader: add log of request’s tracking id (to be able to efficiently communicate with the Tinkoff’s support) Trader: Add log of request's tracking ID for efficient Tinkoff support communication Sep 11, 2025
@konard konard marked this pull request as ready for review September 11, 2025 10:17
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.

Trader: add log of request’s tracking id (to be able to efficiently communicate with the Tinkoff’s support)

2 participants