When the Connect JS (ACJS) library passes values between an app and a product, they are sanitised before being posted between one window and another. This is done because some types can’t be cloned by the structured clone algorithm and would cause a runtime error. As a historic side effect of the implementation of the sanitisation function,
null properties on objects - such as a JSON response from an API - are stripped from the object when being sanitised.
One of our product teams requested the ability to preserve
null object properties in an API response. As this would be a breaking change to the ACJS API this ability was added via an opt-in property on the API method definition. The implementation missed the case where an API response is just plain
null - which is what the
AP.confluence.getContentProperty responds with in the case a content property does not exist.
The existing unit tests for the sanitisation function did not cover this case and the change caused a runtime error when trying to post the
null response. The change was rolled back when we were alerted to the error. Tests have been added to cover this and other cases involving
null values and properties.