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

Komponent's view_renderer is leaking to Rails #144

Closed
robink opened this issue Aug 24, 2019 · 7 comments

Comments

@robink
Copy link
Contributor

commented Aug 24, 2019

This commit seems to have introduce a bug in Rails 5.2 support (and certainly more versions) :

3aed172#diff-d662fd06dc2cbab92ab384c4af54a041L12-R12

It happens that @view_renderer == controller.view_context.view_renderer is now true, which means komponent is leaking its view_renderer manipulation to Rails.

It prevents using both komponent rendering and standard Rails rendering.

@Spone Spone added the bug label Aug 24, 2019
@Spone

This comment has been minimized.

Copy link
Collaborator

commented Aug 26, 2019

@robink can you write a failing test case for this?

@robink

This comment has been minimized.

Copy link
Contributor Author

commented Aug 26, 2019

I think I could indeed ! Just let me a couple of days to find some time to work on it

robink added a commit to derniercri/komponent that referenced this issue Aug 28, 2019
@robink

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

Here you go ;-)

@Spone

This comment has been minimized.

Copy link
Collaborator

commented Aug 28, 2019

Thanks a lot @robink for contributing these tests. They seem to pass on the Rails 6 environment! We have to investigate how to fix this.

@robink

This comment has been minimized.

Copy link
Contributor Author

commented Aug 29, 2019

Well I guess the fix is quite easy if you look at the commit that introduced the bug (cf start of this thread). I'm ok to do it if you want (next week).

@Spone

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2019

Yes I guess we have to do @view_renderer = @context.view_renderer.dup

It would be great if you had the time to try this fix and add it to your PR!

@Spone Spone added this to the 3.0 milestone Sep 18, 2019
Spone added a commit that referenced this issue Sep 18, 2019
* Add failing test case for view_renderer leaking to rails (#144)

* make it works for Rails 6 and prior versions
@Spone

This comment has been minimized.

Copy link
Collaborator

commented Sep 18, 2019

Fixed in #146

@Spone Spone closed this Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.