CASE WHEN EXISTS()

in src/server/helpers/user_reports_transform.ts [53:69]


          CASE WHEN EXISTS (
            SELECT 1 FROM webcompat_user_reports.report_actions
            WHERE report_actions.report_uuid = reports.document_id
            AND report_actions.type != "mark-valid"
          )
          THEN true ELSE false END AS has_actions
        FROM moz-fx-data-shared-prod.firefox_desktop.broken_site_report as reports
        LEFT JOIN webcompat_user_reports.bugbug_predictions AS bp ON reports.document_id = bp.report_uuid
        LEFT JOIN webcompat_user_reports.translations AS ml_trans ON reports.document_id = ml_trans.report_uuid
        WHERE
          reports.submission_timestamp BETWEEN TIMESTAMP(?) and TIMESTAMP(DATE_ADD(?, interval 1 day))
        ORDER BY CHAR_LENGTH(comments) DESC
        ;
      `,
      params: [paramFrom, paramTo],
    }),
    bq.query({