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

Validate existing beacon live data assign #369

Closed
leandrocp opened this issue Nov 2, 2023 · 2 comments · Fixed by #492
Closed

Validate existing beacon live data assign #369

leandrocp opened this issue Nov 2, 2023 · 2 comments · Fixed by #492
Assignees
Labels
enhancement New feature or request proposal Idea in research phase
Milestone

Comments

@leandrocp
Copy link
Contributor

Currently calling @beacon_live_data with an invalid key will just return nil since that's a regular map. That's safe but easy to miss and may result on incorrect behavior.

We want to explore ways to make @beacon_live_data behave more like LV @assign and warn and/or fail to compile if such value is not existing.

@leandrocp leandrocp added enhancement New feature or request proposal Idea in research phase labels Nov 2, 2023
@leandrocp leandrocp added this to the v0.1.0 milestone Apr 24, 2024
@leandrocp
Copy link
Contributor Author

Added to v0.1 since this may cause breaking changes.

@bcardarella
Copy link
Contributor

My recommendation is to copy all of the keys from @beacon_live_data and whatever keys we want to expose from assign into a new assign variable prior to the template compilation. This way we limit to only what we choose to expose for template rendering. Otherwise someone could do this:

<div><%= inspect @sockert, limit: :infinity %></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal Idea in research phase
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants