jsgoupil / quickbooks-sync

Sync Quickbooks Desktop
MIT License
87 stars 40 forks source link

Upgrade to QbSync 2.3.0 causes MissingMethodException #51

Closed tommytayman closed 3 years ago

tommytayman commented 3 years ago

Setup

Visual Studio Version: 16.8.5 Project .NET Version: 5.0.3 QbSync.QbXml Version 2.3.0 QbSync.WebConnector.AspNetCore: 2.0.2

Issue When using QbSync.QbXml version 2.2.0, all steps complete without issue. However, when upgrading to version 2.3.0 (using NuGet package manager), the following error is observed on the first step. Please note the followoing:

image

Request Code

public class Request : StepQueryRequestBase<AccountQueryRqType>
        {
            public override string Name => StepName;
            ///This only exists to ensure we are sending good XML during testing of the 2.3.0 issue
            public override async Task<string> SendXMLAsync(IAuthenticatedTicket authenticatedTicket)
            {
                var results = await base.SendXMLAsync(authenticatedTicket);
                return results;
            }

            protected override Task<bool> ExecuteRequestAsync(IAuthenticatedTicket ticket, AccountQueryRqType request)
            {
                request.ActiveStatus = ActiveStatus.All;
                request.metaData = AccountQueryRqTypeMetaData.NoMetaData;
                request.IncludeRetElement = new []
                {
                    nameof(AccountRet.ListID),
                    nameof(AccountRet.EditSequence),
                    nameof(AccountRet.Name),
                    nameof(AccountRet.FullName),
                    nameof(AccountRet.AccountType),
                    nameof(AccountRet.SpecialAccountType),
                    nameof(AccountRet.AccountNumber)
                };
                return base.ExecuteRequestAsync(ticket, request);
            }
        }

The response class' ExecuteResponseAsync is never called in this scenario.

I don't mind keeping our solution at version 2.2.0, but if I am implementing something incorrectly, I want to ensure I am not version locked here going forward.

Thanks for an awesome project

jsgoupil commented 3 years ago

Can you include the callstack? It seems that this update

https://github.com/jsgoupil/quickbooks-sync/commit/58e479fa847ff96e5325217f33918f4f65679389#diff-be127370af13f6eabf6f607e4bb054334e9bdbda6c96a14482610dff0ab1b7e6R72

Does not work well with the update of only the QbXml. If I update the WebConnector project to another version, could you try a private nuget?

tommytayman commented 3 years ago

No problem, I think here is what you are looking for


   at QbSync.WebConnector.Impl.StepQueryResponseBase`1.<ReceiveXMLAsync>d__3.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at QbSync.WebConnector.Impl.StepQueryResponseBase`1.ReceiveXMLAsync(IAuthenticatedTicket authenticatedTicket, String response, String hresult, String message)
   at DR.Quickbooks.Steps.AccountQuery.Response.<>n__0(IAuthenticatedTicket authenticatedTicket, String response, String hresult, String message)
   at DR.Quickbooks.Steps.AccountQuery.Response.<ReceiveXMLAsync>d__5.MoveNext() in C:\Development\DMS\src\DR.Quickbooks\Steps\AccountQuery.cs:line 64
tommytayman commented 3 years ago

Yeah, I should be able to, though I've never used a private NuGet :)

jsgoupil commented 3 years ago

Add a folder on your machine image

The 2 nuget packages here are only a recompilation of the current code. If it doesn't work, I'll force the parameters.

http://www.jsgoupil.com/temp/QbSync.WebConnector.2.0.2-alpha1.nupkg http://www.jsgoupil.com/temp/QbSync.WebConnector.AspNetCore.2.0.3-alpha1.nupkg

jsgoupil commented 3 years ago

And here are the forced parameters

http://www.jsgoupil.com/temp/QbSync.WebConnector.2.0.2-alpha2.nupkg http://www.jsgoupil.com/temp/QbSync.WebConnector.AspNetCore.2.0.3-alpha2.nupkg

Let me know if the alpha1 works, and if it doesn't try the alpha2.

If it works, I'll push the code, if it doesn't we will have to investigate further!

tommytayman commented 3 years ago

Installing the alpha-1 packages worked flawlessly! I'll downgrade back to the release versions until you all are able to push an official update. Thanks for the quick response and help! Since I didn't support via fork/pull request, do you have a donate link by chance?

jsgoupil commented 3 years ago

That means the QbXml was a breaking change, I didn't notice :( I'll upgrade this one right now.

jsgoupil commented 3 years ago

Here we go. It's listed. Thanks @tommytayman for testing all of this and reporting a thorough bug report!