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

Issue with getErrors using mergeMode: progress.data.JSDO.MODE_MERGE #273

Open
W1nstar opened this issue Jan 14, 2020 · 3 comments
Open

Issue with getErrors using mergeMode: progress.data.JSDO.MODE_MERGE #273

W1nstar opened this issue Jan 14, 2020 · 3 comments

Comments

@W1nstar
Copy link

W1nstar commented Jan 14, 2020

Hello,

I've set up my app to use mergeMode: progress.data.JSDO.MODE_MERGE on read operations so I can deploy a successful pagination system.

It's been working great, but whenever there's an an unsuccessful validation on an update operation, the first time jsdo.getErrors() always returns undefined as error message. The response found inside the request is correctly giving the error, and there's nothing wrong that I've been able to find in the backend.

Also, this doesn't happen without the mergeMode enabled on read operations. I've been trying to track the error throughout the JSDO but it's proven too difficult without full knowledge of it.

What I was able to find is that the _undoUpdate function is called, and is copying a record with _errorString property set to null over a record with the correct _errorString property, wich is then returned. When the assign function is called, even previous to it's first line of code (this._saveBeforeImageUpdate()) or communicating to the server, this.data already has a copy of every record read and stored from the read operation, with an _errorString property set to undefined. I haven't been able to find why or how is this undefined _errorString property on the data collection already.

Second time the assign is called, different methods are called and I lose the thread.

@edselg
Copy link
Contributor

edselg commented Jan 14, 2020

@W1nstar

Thank you for reporting this issue.

Would it be possible for you to provide a reproducible case?

The intention of the undoUpdate() function is to revert the changes performed by an update when an error occurs. The getErrors() function should keep the info on the errors even after a rollback.

Thank you.

@W1nstar
Copy link
Author

W1nstar commented Jan 14, 2020

I can try if there is any open catalog out there. Only one I have is work related and I can't publish it. Do you know of any demo catalog or something similar I could use?

@edselg
Copy link
Contributor

edselg commented Jan 14, 2020

@W1nstar

Here is a catalog and service that you can use to reproduce the issue:

Please give it a try.

Thanks.

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