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

[inspector] Fix exception thrown when inspecting short Eduction #170

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

alexander-yakushev
Copy link
Member

@alexander-yakushev alexander-yakushev commented Aug 1, 2023

Because Eduction type implements clojure.lang.Sequential but not clojure.lang.Counted, the inspector threw an exception when trying to inspect it. A minor but annoying bug. Besides, there could be other similar classes out there, so it's worth fixing.

Before submitting a PR make sure the following things have been done:

  • The commits are consistent with our contribution guidelines
  • You've added tests to cover your change(s)
  • All tests are passing
  • The new code is not generating reflection warnings
  • You've updated the changelog (if adding/changing user-visible functionality)

Thanks!

Copy link
Member

@vemv vemv left a comment

Choose a reason for hiding this comment

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

lgtm!

;; reached the end of the collection, so it's not infinite.
(empty? (drop (* (inc current-page) page-size) obj)) current-page
;; possibly infinite
:else Integer/MAX_VALUE)) cat
Copy link
Member

Choose a reason for hiding this comment

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

cat? 🐱

Copy link
Member Author

Choose a reason for hiding this comment

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

(testing "renders the header section"
(is (match? '("Class"
": "
(:value "clojure.core.Eduction" 0)
Copy link
Member

Choose a reason for hiding this comment

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

Probably worth playing with inspect/next-page as other tests do

Copy link
Member Author

@alexander-yakushev alexander-yakushev Aug 1, 2023

Choose a reason for hiding this comment

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

Its interaction with paging is weird right now (pager shows like it's paged but it's not, it just shows Java fields). See my comment below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, fixed that weird interaction too since it was ugly.

@alexander-yakushev
Copy link
Member Author

This is a band-aid to prevent an exception thrown (and overall a fix that makes the underlying code more correct). Whether an Eduction should be rendered in the current way or differently can be discussed separately.

@alexander-yakushev alexander-yakushev force-pushed the eduction-fix branch 2 times, most recently from c850fac to 2240d36 Compare August 1, 2023 21:27
@vemv
Copy link
Member

vemv commented Aug 1, 2023

Tests are failing on Clojure master

Besides from that, all lgtm, if you want to expand the tests you are on time since I'll create an unrelated PR tomorrow, so it will get all in the same release train.

@alexander-yakushev
Copy link
Member Author

Hmm, looks like a flaky test to me, I don't think I changed anything that could trigger that case.

@alexander-yakushev
Copy link
Member Author

See, passed without changes:)

@vemv vemv merged commit 31a2660 into master Aug 2, 2023
@vemv vemv deleted the eduction-fix branch August 2, 2023 15:27
@vemv
Copy link
Member

vemv commented Aug 2, 2023

🍻!

With a bit of luck we'll have new orchard/cider-nrepl today/tomorrow

@alexander-yakushev
Copy link
Member Author

alexander-yakushev commented Aug 2, 2023

🌳 🌳 🌳 🌳 🌳
🌳 🍎 🍎 🍎 🌳
🌳 🍺 🍺 🍺 🌳
🌳 🥴 🥴 🥴 🌳
🌳 🌳 🌳 🌳 🌳

@vemv vemv mentioned this pull request Aug 3, 2023
@vemv
Copy link
Member

vemv commented Aug 3, 2023

https://clojars.org/cider/cider-nrepl/versions/0.34.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants