Skip to content

fix(e2e): prevent wildcard route from intercepting sync endpoint - #3491

Open
TanCodeX wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
TanCodeX:fix/playwright-goals-sync-route-precedence
Open

fix(e2e): prevent wildcard route from intercepting sync endpoint#3491
TanCodeX wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
TanCodeX:fix/playwright-goals-sync-route-precedence

Conversation

@TanCodeX

@TanCodeX TanCodeX commented Aug 9, 2026

Copy link
Copy Markdown

Summary

Closes #3309


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • Updated the goal deletion route mock in e2e/goals.spec.ts to use a regular expression with a negative lookahead.
  • Excluded /api/goals/sync from the catch-all /api/goals/** route so the dedicated sync mock can handle the request.
  • Prevented the deletion/patch mock from incorrectly intercepting the sync request and returning the empty 204 fallback response.

How to Test

  1. Run npx playwright test e2e/goals.spec.ts.
  2. Verify the goals E2E test suite completes successfully.
  3. Confirm the deletion test passes and /api/goals/sync is handled by its dedicated mock.

Expected result:

All 4 goals E2E tests pass successfully, including [Goals E2E] deleting a goal removes it from the list.


Screenshots / Recordings

Before After

Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log, debug code, or commented-out blocks
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Added or updated tests where applicable
  • Updated documentation / comments if behavior changed

Accessibility (UI changes only)

  • Keyboard navigation works correctly
  • Color contrast meets WCAG AA standard
  • ARIA labels / roles added where needed
  • Tested on mobile / responsive layout

Additional Context

The catch-all route **/api/goals/** was aggressively intercepting POST /api/goals/sync during the goal deletion flow.

The route was changed from:

await page.route("**/api/goals/**", async (route) => {

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Thanks for your first PR on DevTrack! 🎉

A maintainer will review it within 48 hours. While you wait:

  • Make sure CI is passing (type-check + lint)
  • Double-check the PR description is filled out and the issue is linked
  • Feel free to ask questions in Discussions if you need help

If you find DevTrack useful, a ⭐ star on the repo is always appreciated — it helps the project grow and attract more contributors!

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:docs GSSoC type bonus: documentation (+5 pts) type:testing GSSoC type bonus: tests (+10 pts) labels Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:docs GSSoC type bonus: documentation (+5 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fix overly aggressive route interception breaking goals sync mock in E2E tests

1 participant