Skip to content

[Cron Monitoring] Cron schedule with escaped slashes are not supported #50793

@cleptric

Description

@cleptric

PHP's json_encode escapes forward slashes by default. Therefore, sending an envelope containing a cron schedule containing a / is escaped, as all other applicable values.

{
  "monitor_config": {
    "schedule": {
      "type": "crontab",
      "value": "\/10 * * * *",
      "unit": ""
    }
  }
}

Submitting this envelope results in no Cron Monitor being upserted. As the value is still valid JSON, the monitor should be created instead.

Full payload
{
  "event_id": "6aeb2e621f7f4f0ea81c7216786ed0fa",
  "sent_at": "2023-06-13T05:47:38Z",
  "dsn": "https://public-key@o447951.ingest.sentry.io/project-id",
  "sdk": {
    "name": "sentry.php",
    "version": "3.19.1"
  }
}
{
  "type": "check_in",
  "content_type": "application/json"
}
{
  "check_in_id": "a04af92b081d4633a611c3467662ac48",
  "monitor_slug": "upsert-monitor",
  "status": "in_progress",
  "duration": null,
  "release": "1.0.0",
  "environment": "production",
  "monitor_config": {
    "schedule": {
      "type": "crontab",
      "value": "\/10 * * * *",
      "unit": ""
    },
    "checkin_margin": 2,
    "max_runtime": 5,
    "timezone": "Europe/Vienna"
  }
}

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions