updateContext<T> method

  1. @override
void updateContext<T>(
  1. String key,
  2. T value
)
override

Implementation

@override
void updateContext<T>(String key, T value) {
  // Update parent context first
  super.updateContext(key, value);

  // Send updated user context to QA Assistant
  try {
    final messageService = getQAMessageService();

    // Get the complete context after update
    final completeContext = visitor.getContext();

    print('📤 Broadcasting updated user context to QA Assistant');
    print('   Updated key: $key = $value');
    print('   Complete context: $completeContext');

    // Broadcast the complete context
    messageService.broadcastUserContextUpdate(completeContext);

    print('✅ User context broadcasted successfully');
  } catch (e) {
    print('⚠️ Error sending updated user context to QA Assistant: $e');
  }
}