Skip to content

Conversation

@esorense
Copy link
Contributor

Currently, if createPrivateTask fails, the backend returns a raw JSON error (res.send(error)), leaving the user stranded on an API response page.

This PR replaces that with a redirect to the frontend (/#/?createTaskError=true...). This ensures the user is kept within the application flow even when errors occur, preventing a dead-end UX.

@dosubot dosubot bot added the bug label Jan 20, 2026
@alexanmtz
Copy link
Member

Great catch @esorense , we just need to fix the test to expect a redirect response (https://app.circleci.com/pipelines/github/worknenjoy/gitpay/3016/workflows/36a8a5a8-d72e-4251-a442-90e1ea9ee1bd/jobs/4166?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary)

1) tasks
       Task crud
         should receive code on the platform from github auth to the redirected url for private tasks with a valid code:

      Uncaught AssertionError: expected 302 to equal 200
      + expected - actual

      -302
      +200
      
      at Test.<anonymous> (test/task.test.js:422:41)
      at Test.assert (node_modules/supertest/lib/test.js:187:8)
      at Server.localAssert (node_modules/supertest/lib/test.js:135:14)
      at Object.onceWrapper (node:events:631:28)
      at Server.emit (node:events:517:28)
      at emitCloseNT (node:net:2221:8)
      at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

@esorense
Copy link
Contributor Author

Great catch @esorense , we just need to fix the test to expect a redirect response (https://app.circleci.com/pipelines/github/worknenjoy/gitpay/3016/workflows/36a8a5a8-d72e-4251-a442-90e1ea9ee1bd/jobs/4166?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary)

1) tasks
       Task crud
         should receive code on the platform from github auth to the redirected url for private tasks with a valid code:

      Uncaught AssertionError: expected 302 to equal 200
      + expected - actual

      -302
      +200
      
      at Test.<anonymous> (test/task.test.js:422:41)
      at Test.assert (node_modules/supertest/lib/test.js:187:8)
      at Server.localAssert (node_modules/supertest/lib/test.js:135:14)
      at Object.onceWrapper (node:events:631:28)
      at Server.emit (node:events:517:28)
      at emitCloseNT (node:net:2221:8)
      at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Hi @alexanmtz
Fixed! Thanks for catching that.

Copy link
Member

@alexanmtz alexanmtz left a comment

Choose a reason for hiding this comment

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

Thanks @esorense for the contribution 🙏

This will help with the JSON response breaking the screen with raw JSON, but is still missing the endpoint with the query strings you provided to be handle on the front-end and display the notification based on these query string to output the error.

But at least the BE part is ready, and I will create an issue for implement on the FE. If you are interested to implement the missing piece, let me know.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 21, 2026
@alexanmtz alexanmtz merged commit 81beb10 into worknenjoy:master Jan 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants