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

Always pick up instance variables when accessing controller #493

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

leastbad
Copy link
Contributor

Type of PR (feature, enhancement, bug fix, etc.)

Bug fix

Description

Changes Reflex#controller so that it adds any ivars to the controller instance, even if it's been previously memoized.

Fixes #471

Why should this be added

Since controller is memoized, if it is called in a before_reflex callback, any instance variables set in the main Reflex method will not be present in the controller when the page is rendered.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

@leastbad leastbad added this to the 3.4.2 milestone Apr 29, 2021
@leastbad leastbad changed the title solve missing ivars Always pick up instance varibles when accessing controller Apr 29, 2021
@leastbad leastbad changed the title Always pick up instance varibles when accessing controller Always pick up instance variables when accessing controller Apr 29, 2021
@leastbad leastbad mentioned this pull request Apr 29, 2021
@julianrubisch
Copy link
Contributor

LGTM, would be cool if @jonsgreen could cross check

@leastbad
Copy link
Contributor Author

FWIW I did run the MVCE he provided, so hopefully he can verify!

@jonsgreen
Copy link
Contributor

@leastbad @julianrubisch I have also now confirmed that this is fixed on my MVCE. Thanks you for attending to these bugs on top of all the great feature work, documentation and support communication!

@leastbad leastbad merged commit 0ae5f21 into stimulusreflex:master Apr 29, 2021
@leastbad leastbad deleted the instance_vars branch August 16, 2021 03:17
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.

Lost Instance Variables
3 participants