Skip to content

fix: hide today's word on archive, fix unicode word-image 403s#171

Merged
Hugo0 merged 2 commits intomainfrom
fix/words-archive-spoiler-and-unicode
Mar 15, 2026
Merged

fix: hide today's word on archive, fix unicode word-image 403s#171
Hugo0 merged 2 commits intomainfrom
fix/words-archive-spoiler-and-unicode

Conversation

@Hugo0
Copy link
Owner

@Hugo0 Hugo0 commented Mar 15, 2026

Summary

  • Spoiler prevention: Today's word on /{lang}/words now shows a mystery card with ? tiles and a "Play to reveal!" CTA linking to the game, instead of exposing the word, definition, and stats
  • API hardening: The /api/{lang}/words endpoint now returns null for today's word/definition/stats to prevent spoilers even via direct API access
  • Unicode fix: word-image and definition endpoints now normalize the URL word parameter to NFC form, fixing 403 "Not a valid daily word" errors for words with diacritics (ö, é, ü, etc.)

Test plan

  • /en/words — first card should show ????? tiles with green "Play to reveal!" text
  • /de/words — same mystery card for today's word
  • Clicking mystery card navigates to /{lang} game page
  • /de/word/1729 (past word with umlaut) — image should load
  • /api/de/word-image/schön?day_idx=1729 — should return 200 (not 403)
  • /en/words page 2+ — no mystery card (all past words)

- Words archive (/lang/words): today's word now shows a mystery card
  with "?" tiles and "Play to reveal!" CTA instead of spoiling the word
- API: today's entry returns null word/definition/stats to prevent
  spoilers even via API
- word-image & definition endpoints: normalize URL word param to NFC
  to fix 403 errors for words with diacritics (ö, é, etc.)
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Warning

Rate limit exceeded

@Hugo0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20a687dc-42e6-41bc-8e68-c4175d83b520

📥 Commits

Reviewing files that changed from the base of the PR and between eff883d and bb3ea77.

📒 Files selected for processing (5)
  • pages/[lang]/words.vue
  • server/api/[lang]/definition/[word].get.ts
  • server/api/[lang]/word-image/[word].get.ts
  • server/api/[lang]/words.get.ts
  • tests/api.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/words-archive-spoiler-and-unicode
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Filter out today's null word from structured data ItemList to prevent
  SSR crash (toUpperCase on null)
- Update API test to verify today's word is hidden (null) and past words
  are visible
@Hugo0 Hugo0 merged commit fa68083 into main Mar 15, 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.

1 participant