fix: survive a malformed upstream response and an empty chat list - #101
Merged
Conversation
typebot-connector checked `messages` and `clientSideActions` for null but not for shape. A Typebot server returning either as an object or a string raised a TypeError inside the message hook rather than degrading to no bubbles. Both are array-checked now — the upstream is third-party, and its response is untrusted input like any other. chatwoot-adapter marked its one-time bulk backfill complete even when the engine returned no chats. The engine returns an empty list while it is still warming up, and the marker is durable, so a sweep at the wrong moment retired bulk backfill for that session permanently. It now leaves the marker unset and logs, so a later enable tries again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
typebot-connector checked
messagesandclientSideActionsfor null but not for shape. A Typebot server returning either as an object or a string raised a TypeError inside the message hook instead of degrading to no bubbles. Both are array-checked now — the upstream is third-party, and its response is untrusted input like any other.chatwoot-adapter marked its one-time bulk backfill complete even when the engine returned no chats. The engine returns an empty list while it is still warming up, and the completion marker is durable — so a sweep that ran at the wrong moment retired bulk backfill for that session permanently, with no way to retry short of clearing storage. It now leaves the marker unset and logs the skip, so a later enable tries again.
Verification