-
Notifications
You must be signed in to change notification settings - Fork 29
Fix notification config #254
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
base: 5.0
Are you sure you want to change the base?
Changes from 1 commit
34863fa
1ff959a
ee0b48d
c418ace
e497808
72fd11d
9be65b6
16e1d45
1d9575f
44e7167
bd6d4c9
47bcd2c
421568d
a37fcb5
ca4d75b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ def notification_config(minimum_severity: nil, disabled_categories: nil) | |
org.neo4j.driver.internal.InternalNotificationConfig.new( | ||
value_of(org.neo4j.driver.internal.InternalNotificationSeverity, minimum_severity), | ||
disabled_categories | ||
&.map { |value| value_of(org.neo4j.driver.internal.InternalNotificationCategory, value) } | ||
&.map { |value| org.neo4j.driver.NotificationCategory.const_get(value.to_s.upcase) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have been dealing with this issue the following way: https://github.com/neo4jrb/neo4j-ruby-driver/blob/5.0/ruby/neo4j/driver/access_mode.rb There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using NotificationClassification serves as well as a type of documentation. |
||
&.then(&java.util.HashSet.method(:new))) | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsauk could you check. It appears to me that the only change needed was this line:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, additionally move the
.or_else(nil)
fromvalue_of
method to the line 71 as thevalue_of
of java enum, which NotificationClassification now is, does not returnOptional
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote the rest of this method using the Java driver's public API so we rely less on internals.
InternalNotificationSeverity works with
value_of
, but NotificationSeverity fails because it's an interface. As far as I can understand, we can't use the same approach for both (unless it'sconst_get
).