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.

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly point to the codebase URL and provide clear steps to help a contributor get set up for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3