<< Back to previous view

[NREPL-52] Middleware linearizes wrong with redundant :expects entries Created: 02/May/14  Updated: 02/May/14  Resolved: 02/May/14

Status: Closed
Project: tools.nrepl
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Gary Fredericks Assignee: Chas Emerick
Resolution: Duplicate Votes: 0
Labels: None


 Description   

Consider the following:

(def wrap-foo identity)
(mid/set-descriptor! #'wrap-foo
                     ;; note that these two entries are redundant since
                     ;; the session middleware implements "clone"
                     {:expects #{#'clojure.tools.nrepl.middleware.session/session "clone"}})

;; this one returns correctly
(mid/linearize-middleware-stack [#'wrap-foo
                                 #'clojure.tools.nrepl.middleware.session/session])
;; => (#'clojure.tools.nrepl.middleware.session/session
       #'user/wrap-foo)


;; this one returns incorrectly -- note that by adding a presumably
;; unrelated extra middleware to the stack, session and wrap-foo have
;; switched their order relative to each other.
(mid/linearize-middleware-stack [#'wrap-foo
                                 #'cider.nrepl.middleware.stacktrace/wrap-stacktrace
                                 #'clojure.tools.nrepl.middleware.session/session])
;; => (#'user/wrap-foo
       #'clojure.tools.nrepl.middleware.pr-values/pr-values
       #'cider.nrepl.middleware.stacktrace/wrap-stacktrace
       #'clojure.tools.nrepl.middleware.session/session)


 Comments   
Comment by Gary Fredericks [ 02/May/14 10:08 PM ]

I'm going to close this since I think NREPL-53 gets more to the root of the matter.

Generated at Thu Oct 30 11:09:53 CDT 2014 using JIRA 4.4#649-r158309.