Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Approving/rejecting leave request fails with unexpected error #646

Closed
haydn opened this issue Jul 7, 2023 · 6 comments
Closed

Approving/rejecting leave request fails with unexpected error #646

haydn opened this issue Jul 7, 2023 · 6 comments

Comments

@haydn
Copy link

haydn commented Jul 7, 2023

SDK:

  • Version 4.35.0

Describe the bug

The API endpoints for approving/rejecting leave applications that were recently added the AU payroll fail. Additionally, there's no proper error returned.

To Reproduce

Steps to reproduce the behavior:

  1. Create a leave application in the "requested" state.
  2. Try to approve the leave application using xero.payrollAUApi.approveLeaveApplication(TENANT_ID, LEAVE_APPLICATION_ID)

This throws an error with this message:

Unexpected error value: { response: [Object], body: undefined }

If I enable Node's http debugging, I can see this for the response:

...
HTTP 72296: sockets api.xero.com:443::::::::::::::::::::: 1 1
HTTP 72296: outgoing message end.
HTTP 72296: AGENT incoming response!
HTTP 72296: AGENT socket.destroySoon()
HTTP 72296: CLIENT socket onClose
HTTP 72296: removeSocket api.xero.com:443::::::::::::::::::::: writable: false
HTTP 72296: HTTP socket close

So it looks like the API is failing to produce a response of any kind.

If I try to approve the leave application via the API explorer it fails without any message (so I assume the same thing is happening). I can successfully retrieve the leave application using the get leave application endpoint.

Logging into Xero and approving the leave application works fine.

Expected behavior

It should approve the leave application (or at least display an error message explaining what's wrong).

Screenshots

N/A

Additional context

N/A

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

PETOSS-315

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Thanks for raising an issue, a ticket has been created to track your request

@rdemarco-xero
Copy link
Contributor

Thanks for reporting these issues @haydn ! We'll get these things fixed soon and keep you posted.

@haydn
Copy link
Author

haydn commented Jul 31, 2023

@rdemarco-xero I'm no longer seeing this issue or #645. Were some changes made to fix these? When I encountered this bug I was using a demo account — perhaps that demo account was in an invalid state? Testing with a fresh demo account now works just fine.

@rdemarco-xero
Copy link
Contributor

Hi @haydn, this issue plus #645 were legitimate issues with our public endpoint. The team was able to release a fix last week. Glad it is working for you now. Will get a fix out to the SDK for #643 soon.

@haydn
Copy link
Author

haydn commented Aug 1, 2023

@rdemarco-xero Thanks for following this up! Very much appreciated.

Do you happen to know if creating leave applications with a "REQUESTED" status is on the cards? It's the last piece of the puzzle we need to make a seamless leave management experience.

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

No branches or pull requests

2 participants