You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Fix invalid TypeScript property in encode and make settings mock stateful #3305
TypeScript Error: The encode function from next-auth/jwt does not accept a cookieName property in its parameter object. Including it causes a TypeScript compilation error (Object literal may only specify known properties).
Stateless Mocking causing Flakiness/Failure: The intercepted **/api/user/settings route is stateless. It hardcodes is_public: false for all GET requests. When the test clicks the toggle to enable the public profile, the frontend sends a PATCH request (which the mock handles). However, modern data-fetching libraries (like SWR or React Query) typically invalidate their cache after a mutation, triggering an immediate GET request to re-sync the UI. This subsequent GET request hits the mock, receives the hardcoded is_public: false, and instantly reverts the checkbox to an unchecked state, causing the expect(...).toBeChecked() assertion to fail.
Steps to Reproduce
Run the Playwright test in a strictly typed Next.js/TypeScript environment; it will fail to build due to the invalid cookieName property.
If compilation passes, the test navigates to /dashboard/settings and clicks the "Toggle Public Profile" track.
The frontend dispatches a PATCH request to update the setting.
The frontend invalidates its cache and dispatches a GET request to **/api/user/settings.
The mock intercepts the GET request and returns { is_public: false }.
The frontend receives the stale data and flips the toggle back to unchecked.
The test assertion await expect(publicProfileCheckbox).toBeChecked() fails because the checkbox is now unchecked.
Activity
rudrakshtank commentedon Jul 31, 2026
/assign
github-actions commentedon Jul 31, 2026
Assigned to @rudrakshtank! You have 7 days to open a PR. No PR after 7 days = auto-unassigned so others can pick it up. Good luck!
github-actions commentedon Jul 31, 2026
✅ Closed as completed!
If DevTrack has been useful, a ⭐ star on the repo helps the project grow and reach more developers.