Fix stream_name calculation inside of thread #727
Merged
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.
Calculating the stream_name from within the
ThreadDebouncerwas leading to incorrect stream channel names in my setup where theglobal_idincludes the Tennant id. It's a multi-tenant application and the current database name forms part of theglobal_id. Within theThreadDebouncerit would seem to fixate on a particular database connection rather than the connection used by the current request.Simply calculating the
stream_namebefore invoking theThreadDebouncerfixed the issue.I don't see the need for additional tests unless you wanted to test my failure scenario but I'm not quite sure how to do that.