lib/utils/tracking.js/request
function request(type, event, { id, timeout } = {}) {
  ++ongoingRequestsCount;
  const startTime = Date.now();
  return fetch(urls.get(type), {
    headers: {
      'content-type': 'application/json',
    },
    method: 'POST',
    // Ensure reasonable timeout to not block process from exiting
    timeout: timeout || 1500,
    body: JSON.stringify(event),
  }).then(
    response => {
      if (response.status < 200 || response.status >= 300) {
        logError('Unexpected request response', response);
        return processResponseBody(response, id, startTime);
      }
      if (!id) return processResponseBody(response, id, startTime);
      return fse.unlinkAsync(join(cacheDirPath, id)).then(
        () => processResponseBody(response, id, startTime),
        error => {
          logError(`Could not remove cache file ${id}`, error);
          return processResponseBody(response, id, startTime);
        }
      );
    },
    networkError => {
      logError('Request network error', networkError);
      return null;
    }
  );
}