docs: function toStorableMessageState(messageState, message, context) {
    if (!messageState) {
      context.warn(`Skipping save of state for message, since it has no state - message (${JSON.stringify(message)})`);
      return undefined;
    }
  
    // Convert the message's state into a safely storable object to get a clean, simplified version of its state
    const state = dynamoDBUtils.toStorableObject(messageState);
  
    // If state has no message identifier then have no way to identify the message ... so attach a safely storable copy of
    // its original message, user record or record (if any) (i.e. without its legacy state, if any, for later matching)!
    if (!hasMessageIdentifier(messageState)) {
      message = message || messageState.message;
  
      if (message) {
        // Make a storable copy of the message & attach it to the storable state
        state.message = dynamoDBUtils.toStorableObject(message);
        // Remove the message copy's LEGACY state (if any) to get back to the original message
        tracking.deleteLegacyState(message, context);
      }
      else if (messageState.userRecord) {
        // If has no message, then attach a copy of its user record
        // Make a storable copy of the unusable user record & attach it to the storable state
        state.userRecord = dynamoDBUtils.toStorableObject(messageState.userRecord);
        // Remove the unusable user record copy's LEGACY state (if any) to get back to the original user record
        tracking.deleteLegacyState(state.userRecord, context);
      }
      else if (messageState.record) {
        // If has no message AND no user record, then attach a copy of its record
        // Make a storable copy of the unusable record & attach it to the storable state
        state.record = dynamoDBUtils.toStorableObject(messageState.record);
        // remove the unusable record copy's LEGACY state (if any) to get back to the original record
        tracking.deleteLegacyState(state.record, context);
      }
    }
    return state;
  }