Page MenuHomePhabricator

Test Kitchen: make sure action_context is always a string
Open, HighPublic1 Estimated Story Points

Description

Description

In the PHP and JS SDKs, action_context should be processed to always return a string to pre-empt validation errors related to this property.

Use JSON.stringify() on action_context before sending events

Acceptance Criteria

  • SDKs ensure action_context is always a string
  • Include/update test cases

Event Timeline

Notes:

  1. To confirm, we're talking about when developers are using the Test Kitchen SDKs and not the Event Platform SDKs?
  2. We need to ensure that we support developers using custom streams and schemas

I figure the solution looks something like:

Experiment.js
class Experiment {
  send( action, interactionData ) {
    // ...
    if ( event.action_context && typeof event.action_context !== 'string' ) {
      event.action_context = JSON.stringify( event.action_context );
    }
  }
}
JVanderhoop-WMF moved this task from Incoming to Backlog on the Test Kitchen board.
JVanderhoop-WMF set the point value for this task to 1.