-
Notifications
You must be signed in to change notification settings - Fork 57
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
max call size stack error when trying to update entity after getByKey #3930
Comments
Hi @lincheney, Could you please share the edmx specification file and the payload you got from executing the |
Hello I am getting this error when I am getting+updating maintenance plans and maintenance items. I have included payloads at the bottom. I want to note that this error does not occur if before performing the update I do: (entity as any).remoteState._entityApi = null; or const entityApi = entity._entityApi;
delete (entity as any)._entityApi;
// make _entityApi non enumerable
Object.defineProperty(entity, '_entityApi', {value: entityApi}); but obviously these are some pretty awful hacks. Notably, I also get this error if I attempt to
I believe this circular JSON error is indicative of why the Here is what the payload looks like from the
And here is same again but the
|
Hi @lincheney , So I executed the same request against the SAP Business Accelerator Hub Sandbox and it worked for me. Below is the code I tried:
You mentioned you execute the following code before an update request:
However, we do set the Can you confirm you have the latest dependencies for all sdk packages, including |
Hi @deekshas8 Thanks for your reply. tldr I did some more debugging and found the issue is caused by microsoft/TypeScript#45584
Thanks for this tip. So I checked the version of odata-common I have and it is latest, and I also checked the JS inside my Anyway, after much debugging, I discovered that the issue is due to the way that Essentially what is happening is that when class MaintenanceItem extends odata_v2_1.Entity {
_entityApi;
maintenanceItem;
maintenanceItemDescription;
// etc etc etc
constructor(_entityApi) {
super(_entityApi);
this._entityApi = _entityApi;
}
} The problem is the second line; this causes If I explicitly set class MaintenanceItem extends odata_v2_1.Entity {
constructor(_entityApi) {
super(_entityApi);
this._entityApi = _entityApi;
}
} which does not have the problem. As an aside, this actually causes an additional problem that I had not mentioned earlier as I had not realised it was related. const entity = api.entityBuilder().maintenanceItem('12345').functionalLocationLabelName('blahblah').build(); with the expectation that this would construct a JSON payload with only the For now, if I set However, I would be interested to know if sap-cloud-sdk will support |
Hi @lincheney , Sorry for the late response. Thank you for investigating this and your findings. I have created a backlog item for this. We will update you when this is supported. |
Hello @deekshas8 Running the following versions:
Kindly keep me updated aswell. Br, |
Hi @lincheney , @ThomasL81, the fix is part of the newly released |
Describe the bug
A clear and concise description of what the bug is.
I'm trying to update entity according to the documentation here: https://sap.github.io/cloud-sdk/docs/js/features/odata/v2-client#updaterequestbuilder
The code I have looks like:
But when the code runs, the following error is thrown (along with warnings):
I did a bit of debugging and found it is trying to check the
entity._entityApi
if it has changed and therefore should be included in the request payload, but it is getting stuck recursing through it.To Reproduce
Steps to reproduce the behavior:
See above.
Expected behavior
A clear and concise description of what you expected to happen.
The update call should work.
Screenshots
If applicable, add screenshots to help explain your problem.
Used Versions:
node -v
- v18.16.0npm -v
- 9.5.1Code Examples
If applicable, add code snippets as examples to help explain your problem. Please remove sensitive information.
See above
Log file
If applicable, add your log file or related error message. Again, please remove your sensitive information.
Impact / Priority
Affected development phase: e.g. Getting Started, Development, Release, Production
Impact: e.g. No Impact, Inconvenience, Impaired, Blocked
Timeline: e.g. Go-Live is in 12 weeks.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: