Skip to content

fix(auth): quote reserved "window" column in rate-limit SQL for Postgres - #946

Merged
ascorbic merged 2 commits into
emdash-cms:mainfrom
LeanderG:fix_window_quotes
May 8, 2026
Merged

ascorbic merged 2 commits into
emdash-cms:mainfrom
LeanderG:fix_window_quotes

Conversation

@LeanderG

@LeanderG LeanderG commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #935 by quoting Postgres reserved keyword window.

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

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool:

Screenshots / test output

@changeset-bot

changeset-bot Bot commented May 8, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1b9ec19

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/admin Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions Bot added size/S and removed size/XS labels May 8, 2026
@ascorbic

ascorbic commented May 8, 2026

Copy link
Copy Markdown
Member

/review

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good find! Thanks

@ask-bonk

ask-bonk Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

The fix is correct, minimal, and targeted. Maintainer (ascorbic) already approved with "Good find! Thanks". The fix:

  1. Quotes window in the INSERT, ON CONFLICT, and DELETE raw SQL queries — required for Postgres where WINDOW is reserved.
  2. Double-quoted identifiers are SQL-standard and work in both SQLite and Postgres, so this doesn't break SQLite.
  3. Migration file uses Kysely's schema builder which handles quoting automatically — no migration changes needed.
  4. Includes a changeset.

The PR is small, surgical, and correct. The maintainer has already given positive feedback.

LGTM!

github run

@pkg-pr-new

pkg-pr-new Bot commented May 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

emdash

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

create-emdash

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

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

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 1b9ec19

@ascorbic
ascorbic enabled auto-merge (squash) May 8, 2026 11:42
@ascorbic
ascorbic merged commit c4ee7ad into emdash-cms:main May 8, 2026
29 checks passed
@emdashbot emdashbot Bot mentioned this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PASSKEY_OPTIONS_ERROR: syntax error at or near "window" - rate limiter uses unquoted PostgreSQL reserved keyword

2 participants