craftcms / craftcms/webhooks

SQL Error when response body contains unsupported characters

Open
#89 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
84
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Description

We are getting errors when the webhook fires and receives a response body containing emojis, specifically :
[273218] Sending webhook “ISR cache bust Entries” (attempt: 2, pid: 249507) - Error (time: 3.632s): SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x93\x8D O...' for column 'responseBody' at row 1

Steps to reproduce
  1. create webhook that requests a page with emojis in the body
  2. trigger webhook
Additional info
  • Craft version: 4.5.11.1
  • PHP version: 8.2.1
  • Database driver & version: MySQL 5.7.42
  • Plugins & versions: Webhooks 3.0.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by locating where webhook response bodies are persisted and inspect how the responseBody column handles emoji characters under MySQL 5.7. Reproduce the webhook with an emoji-containing response, then verify the response is stored without the SQL error and add a regression test if the project has coverage for this path.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.