pulsar-edit / package-backend

Pulsar Server Backend for Packages
https://api.pulsar-edit.dev
MIT License
11 stars 11 forks source link

Quick and dirty hack to avoid max call stack size limits #256

Closed confused-Techie closed 1 week ago

confused-Techie commented 2 months ago

Requirements

Description of the Change

While this likely isn't the best solution, it's the best I could determine on a short notice to remove this error from production.

The error stems from the fact that it seems superagent in it's error returns uses many references to other objects in it's error, which seems to create some situations where an object will have an infinite depth if following all the references that reference parent objects and such.

This quick and dirty method of avoiding reaching any call stack limits just limits the maximum depth we sanitize to 15 levels. While not perfect should work for our use cases.

Fixes #252