-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fix RuleOrderedActivation Fressian Handler #395
base: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
|
@@ -492,11 +492,13 @@ | |
(.writeObject w (.-node-id ^RuleOrderedActivation c) true) | ||
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. Could we recap the discussion about the non-usage of this handler in a sentence or two of comments inline here? |
||
(.writeObject w (.-token ^RuleOrderedActivation c)) | ||
(.writeObject w (.-activation ^RuleOrderedActivation c)) | ||
(.writeInt w (.-rule-load-order ^RuleOrderedActivation c)))) | ||
(.writeInt w (.-rule-load-order ^RuleOrderedActivation c)) | ||
(.writeBoolean w (.-use-token-identity? ^RuleOrderedActivation c)))) | ||
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. Clojure makes fields with metadata I'd expect 2 things here:
In There is no protocol function implemented that gives access to this field however. It may be reasonable to add another function to the It wouldn't be too difficult to test this handler "round tripping" a 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. Example of testing it: (require 'clara.test-fressian)
(in-ns 'clara.test-fressian)
(require '[clara.rules.memory :as mem])
(let [act (mem/->RuleOrderedActivation 1 nil nil 1 false)]
(test-serde act)) |
||
:readers {"clara/ruleorderactivation" | ||
(reify ReadHandler | ||
(read [_ rdr tag component-count] | ||
(mem/->RuleOrderedActivation (.readObject rdr) | ||
(.readObject rdr) | ||
(.readObject rdr) | ||
(.readObject rdr) | ||
(.readObject rdr))))}} | ||
|
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.
Could we indicate directly in the changelog that the functional impact here is very limited as discussed at #394 (comment) and #395 (review) ? I'd like to avoid unnecessary user concern. Something like "The bug is only exposed if reusing the Clara Fressian handlers outside of Clara's direct APIs"