Skip to content

fix: prove guest Clerk linking on MySQL and add CI - #115

Merged
shitratgit[bot] merged 4 commits into
mainfrom
afe-114-guest-link-ci
Nov 10, 2026
Merged

shitratgit[bot] merged 4 commits into
mainfrom
afe-114-guest-link-ci

Conversation

@shitratgit

@shitratgit shitratgit Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #114, which merged without CI or review. This PR adds both, and proves the path the original bug hit.

What it fixes

  • Profile length limits count code points (what MySQL counts for utf8mb4), not UTF-16 units. Legal emoji names are no longer dropped.
  • If writing a Clerk name or image still fails with errno 1366 (character the column can't store, e.g. an emoji on a utf8mb3 table) or 1406 (too long), the write is retried once without the cosmetic fields. On the guest-link update it keeps the row's stored name and image. The account link always saves, so a profile value can't block workshop access. One warning is logged (field, length, errno; no values).

Proof

  • New users.mysql.test.ts runs the real getCourseBuilderUserForClerkUser against MySQL tables generated from src/db/schema.ts, seeding a guest-checkout row and linking a Clerk user by email. 8 cases at utf8mb4 and again at utf8mb3, including a 256-char avatar (the original bug), a 261-char name, emoji names, keeping a stored image, and keeping a stored name when the fallback fires.
  • Run locally on MySQL 8.4.11: 17/17 pass. Skips cleanly when AFE_TEST_MYSQL_URL is unset.
  • A blind review of fix: a long Clerk avatar URL no longer blocks workshop access #114 (Grok, diff only) approved it and named the gaps this PR closes.

CI (.github/workflows/ci.yml): on pull requests and pushes to main, with a MySQL 8 service, pnpm frozen install, and the website tests.

  • workshop-not-found.test.ts is excluded with a comment: it already fails on main (21268df) with no-store vs an expected public cache header. That needs its own fix.
  • Typecheck isn't in CI yet: it fails on main in files this PR doesn't touch.
  • No packageManager in the root package.json, so CI uses pnpm 10 until one is added.

Asks for a maintainer: protect main and require one review plus this check. The bot can't change repo settings.

Out of scope, noted: the email column on insert and the fields column aren't length-guarded.

SR 🐀

@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for codetv ready!

Name Link
🔨 Latest commit 7906f7f
🔍 Latest deploy log https://app.netlify.com/projects/codetv/deploys/6af2d3a2901e5892e5002cdb
😎 Deploy Preview https://deploy-preview-115--codetv.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for codetv-automations ready!

Name Link
🔨 Latest commit 7906f7f
🔍 Latest deploy log https://app.netlify.com/projects/codetv-automations/deploys/6af2d3a204b813093d1634b9
😎 Deploy Preview https://deploy-preview-115--codetv-automations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for codetv-links ready!

Name Link
🔨 Latest commit 7906f7f
🔍 Latest deploy log https://app.netlify.com/projects/codetv-links/deploys/6af2d3a26ed8afb6a470b36d
😎 Deploy Preview https://deploy-preview-115--codetv-links.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@shitratgit
shitratgit Bot merged commit b812ffb into main Nov 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants