Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly parse blockchain subscription name when delivering events #1378

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

awrichar
Copy link
Contributor

This ensures the namespace can be accurately extracted.

Fixes #1374

Comment on lines 339 to 346
if len(subName) > UUIDLength {
uuidStart := len(subName) - UUIDLength
prefix := subName[:uuidStart-1]
listenerID := subName[uuidStart:]
if _, err := uuid.Parse(listenerID); err == nil {
parts = strings.Split(prefix, "-")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace names are also allowed to have dashes which I think would cause problems here

This ensures the namespace can be accurately extracted.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
@codecov-commenter
Copy link

Codecov Report

Merging #1378 (c2491cc) into main (cd1531d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1378   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         315      315           
  Lines       22055    22061    +6     
=======================================
+ Hits        22051    22057    +6     
  Misses          2        2           
  Partials        2        2           
Files Changed Coverage Δ
internal/blockchain/common/common.go 100.00% <100.00%> (ø)

@nguyer nguyer merged commit 0121780 into hyperledger:main Jul 26, 2023
@nguyer nguyer deleted the blockchain-ns branch July 26, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blockchain events are delivered to every namespace by blockchain plugin
3 participants