fix: be a more tolerant reader of decide response #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When starting the example app pointing at my local instance (but it would have been true of most any instance of PostHog)
The application was exploding because the client was trying to deserialize the
sessionRecording
property of thedecide
response into aboolean
but it is onlyboolean
whenFalse
otherrwise it's an object.Since the web SDK is the closest we have to a reference SDK it is relatively common for us to both implicitly and explicitly rely on the type of things being
boolean | BlahConfig
for example https://github.com/PostHog/posthog-js/blob/e0c4ba4f3610c17480b8b250c9b3a11cc160cc3e/src/types.ts#L532Since properties that are
boolean
today could change to beboolean | BlahConfig
in future I opted to remove properties that looked mostly front-end specific. To avoid them explodingI don't think we can support web sdk things like heatmaps and session recording in this SDK
And can add them back when we need them if we can support them here