Skip to content

test(e2e): correct the Cloudflare skip-comment characterizations#1327

Merged
ascorbic merged 1 commit into
mainfrom
fix/cf-skip-comments
Jun 4, 2026
Merged

test(e2e): correct the Cloudflare skip-comment characterizations#1327
ascorbic merged 1 commit into
mainfrom
fix/cf-skip-comments

Conversation

@ascorbic
Copy link
Copy Markdown
Collaborator

@ascorbic ascorbic commented Jun 4, 2026

What does this PR do?

Follow-up to #1322. Corrects the FIXME(cloudflare) comments on the two CF-skipped tests after investigating them — the merged PR pinned both on "suspected D1 Sessions read-after-write," which is wrong (miniflare D1 is a strongly-consistent local SQLite file, so a read-after-write lag is impossible).

Both tests stay skipped, now with accurate characterizations:

  • i18n › shows Edit link for existing translationsbackend verified correct on D1 (the translations API returns both siblings). The flake is a dev-runtime artifact: the workerd dev runner's Vite optimizer re-bundles mid-test and stalls the translations-sidebar fetch, so the "Edit" link occasionally renders past the helper's timeout. I explored a fix — a browser-based admin-chunk warm-up in global-setup — and it made the test reliable locally (~2.4s), but on CI's slower 2-core runner the render still exceeded a reasonable timeout, and the resource-heavy warm-up destabilized other shards. So it's reverted; the test stays skipped with the accurate comment. Not a product bug (production has no Vite optimizer).
  • invite-flow › invited user appears in the users list — passkey-gated write path I couldn't reach to verify. Re-characterized: if the read genuinely misses the write on strongly-consistent local D1, it's a real code bug (likely a SQLite-vs-D1-dialect difference), not a dev artifact. Flagged for maintainers; needs a browser-driven repro.

No behavior change — comments + skip-reason strings only.

Closes #

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

Notes: test-only comment/string corrections — no code change, no published package, no admin strings, not a feature.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.8 (Claude Code)

Screenshots / test output

N/A — comment + skip-reason corrections only.

Matt's point — miniflare D1 is a local SQLite file, strongly consistent, so a
read-after-write 'lag' isn't possible; a missed read would be a real code bug.

Investigated both:
- i18n translations: reproduced against live D1 — the backend is CORRECT (the
  translations API returns both siblings, translation_group is right). The
  failure is front-end render timing on the slower workerd dev runtime, not a
  D1 bug. Comment corrected.
- invite-flow: couldn't reach the user-creation path without the passkey
  ceremony; re-characterized as a possible real SQLite-vs-D1-dialect bug needing
  a browser-driven repro, no longer hand-waved as a dev consistency artifact.
Copilot AI review requested due to automatic review settings June 4, 2026 06:36
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 4, 2026

⚠️ No Changeset found

Latest commit: 33476b8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added review/needs-review No maintainer or bot review yet size/S labels Jun 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Cloudflare/workerd-specific skip annotations in the e2e suite to reflect the investigated root causes more accurately (comment + skip-reason string adjustments only), keeping the Cloudflare lane green while documenting the current understanding of the failures.

Changes:

  • Rewrites the FIXME(cloudflare) rationale and skip message for the invite-flow “invited user appears in the users list” spec.
  • Rewrites the FIXME(cloudflare) rationale and skip message for the i18n “shows Edit link for existing translations” spec.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
e2e/tests/invite-flow.spec.ts Updates Cloudflare-skip commentary and skip reason string for the passkey invite user-list spec.
e2e/tests/i18n.spec.ts Updates Cloudflare-skip commentary and skip reason string for the translations sidebar “Edit” link timing spec.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/tests/i18n.spec.ts
Comment on lines +185 to +187
// issue specific to the slower workerd dev runtime — the sibling
// `clickEditTranslation` test (208) passes because `.click()` waits
// longer than this `isVisible` check. Skipped so the CF lane stays green.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 33476b8 Jun 04 2026, 08:30 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 33476b8 Jun 04 2026, 08:31 AM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 33476b8 Jun 04 2026, 08:31 AM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 4, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1327

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1327

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@1327

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1327

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1327

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@1327

emdash

npm i https://pkg.pr.new/emdash@1327

create-emdash

npm i https://pkg.pr.new/create-emdash@1327

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1327

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@1327

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@1327

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@1327

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@1327

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@1327

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1327

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1327

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1327

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1327

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1327

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1327

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@1327

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1327

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1327

commit: 33476b8

Copy link
Copy Markdown
Contributor

@emdashbot emdashbot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR correctly fixes misleading skip-reason characterizations from #1322. The reasoning is sound: miniflare D1 is a local SQLite file, so read-after-write "consistency" artifacts are not possible — if a read misses a committed write it indicates a real code bug or a front-end timing issue, not a dev-environment consistency lag. The comment corrections and updated skip strings are appropriate.

I checked the two changed files, traced the referenced helper methods (hasEditTranslationLink, clickEditTranslation) in e2e/fixtures/admin.ts, and verified there are no behavior changes, no AGENTS.md convention violations, and no changeset requirement (test-only). The implementation is clean.

One minor suggestion: a stale line-number reference in the i18n.spec.ts comment that should be corrected before merge.

Comment thread e2e/tests/i18n.spec.ts
// D1 returns both siblings correctly (EN's translation_group is
// self-referential, FR's points to EN). It's a front-end render-timing
// issue specific to the slower workerd dev runtime — the sibling
// `clickEditTranslation` test (208) passes because `.click()` waits
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] The comment references (208) as the line of the sibling clickEditTranslation test, but in this file clickEditTranslation is called at line 248 (and 298); the test definition itself is at line 221. In the base branch it was at line 246. The 208 reference appears stale or copied from an intermediate revision and will mislead anyone following the breadcrumb in the future.

Suggested change
// `clickEditTranslation` test (208) passes because `.click()` waits
// `clickEditTranslation` test (line 248) passes because `.click()` waits

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Jun 4, 2026
@ascorbic ascorbic changed the title test(e2e): correct the Cloudflare skip-comment characterizations test(e2e): un-skip the i18n CF test via an admin-chunk warm-up (+ correct invite comment) Jun 4, 2026
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review size/M cla: signed and removed size/S review/awaiting-author Reviewed; waiting on the author to respond labels Jun 4, 2026
@ascorbic ascorbic force-pushed the fix/cf-skip-comments branch from 9cf5f0d to 33476b8 Compare June 4, 2026 08:28
@ascorbic ascorbic changed the title test(e2e): un-skip the i18n CF test via an admin-chunk warm-up (+ correct invite comment) test(e2e): correct the Cloudflare skip-comment characterizations Jun 4, 2026
@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond size/S and removed size/M review/needs-rereview Author pushed changes since the last review labels Jun 4, 2026
@ascorbic ascorbic merged commit f4dd4b0 into main Jun 4, 2026
91 checks passed
@ascorbic ascorbic deleted the fix/cf-skip-comments branch June 4, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed review/awaiting-author Reviewed; waiting on the author to respond size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants