Open dylanexpensify opened 1 month ago
Triggered auto assignment to @stephanieelliott (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Job added to Upwork: https://www.upwork.com/jobs/~01f23c70a65cf3f85e
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External
)
When invalid credentials are used to connect to Sage Intacct, no Retry, Backup, and Retry (RBR) mechanism is triggered, resulting in an "invalid credentials" or "authentication failure" error.
The root cause of this problem is likely due to an incorrect implementation of the Sage Intacct API or a misconfiguration of the connection settings, which prevents the RBR mechanism from kicking in when invalid credentials are used.
To solve this problem, we need to review and adjust the Sage Intacct API implementation to ensure that it correctly handles invalid credentials and triggers the RBR mechanism. Specifically, we should:
Verify Sage Intacct credentials and connection settings. Set API endpoint and headers correctly. Set XML payload to retrieve subsidiary information. Send request to Sage Intacct API and check if response is invalid credentials error. If invalid credentials error, trigger RBR mechanism. Here is an example code snippet to illustrate the solution:
// Verify Sage Intacct credentials and connection settings
const sageIntacctCredentials = {
userId: 'your_user_id',
password: 'your_password',
companyId: 'your_company_id'
};
// Set API endpoint and headers
const endpoint = 'https://api.intacct.com/ia/xml/xmlgw.aspx';
const headers = {
'Content-Type': 'application/xml',
'Authorization': `Basic ${sageIntacctCredentials.userId}:${sageIntacctCredentials.password}`
};
// Set XML payload to retrieve subsidiary information
const payload = `
<?xml version="1.0" encoding="UTF-8"?>
<request>
<control>
<senderid>${sageIntacctCredentials.companyId}</senderid>
<password>${sageIntacctCredentials.password}</password>
<controlid>string</controlid>
<uniqueid>false</uniqueid>
<dtdversion>3.0</dtdversion>
</control>
<operation>
<authentication>${sageIntacctCredentials.companyId}</authentication>
<get>
<object>subsidiary</object>
</get>
</operation>
</request>
`;
// Send request to Sage Intacct API
const response = await fetch(endpoint, {
method: 'POST',
headers,
body: payload
});
// Check if response is invalid credentials error
if (response.status === 401) {
// Trigger RBR mechanism
console.log('Invalid credentials, triggering RBR...');
// Implement RBR logic here
} else {
console.log('Error:', response.statusText);
}
@kabeer95 Can you please familiarize yourself with our codebase and some old proposals on closed issues to understand what is expected in a proposal?
@dylanexpensify @stephanieelliott Script link is of internal SO and is not accessible to everyone. Is there any way to add(or access script) the for adding/testing the test Sage Intacct?
I was implementing this so you can assign me. This is probably caused by the way we handle incorrect credentials on Sage Intacct. @NikkiWines should have more context. I guess our solution to incorrect credentials has some downsides 😅
@stephanieelliott please assign @SzymczakJ from SWM
📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
This one's a backend bug so i'll try and patch it when I've got some spare cycles - adjusting the labels accordingly
@NikkiWines @stephanieelliott @SzymczakJ @situchan this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Sorry guys, been swamped with competing priorities these last few weeks, will try to prioritize this as soon as i have time
🤔 Seems to be a RBR for me when I enter invalid creds locally, but I do see the connected to Sage Intacct
message still. I'll update it so we don't send that message if the connection fails
https://github.com/user-attachments/assets/374aab41-69c6-4676-b8c0-a13068ca8122
Not overdue
Testing doc: here (request, will share)
Pre-testing steps
Daily
or “slower”Pre-testing steps
Steps:
Connect
Expected result: A RBR is shown on Accounting in LHN and on the Connections card in Accounting. Actual result: No RBR is present, and the #admins page shows that the connection occurred
Screenshot LHN:
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @NikkiWines