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

[WIP] Fix same custom route_setting value ignoreing problem #2174

Closed
wants to merge 3 commits into from
Closed

[WIP] Fix same custom route_setting value ignoreing problem #2174

wants to merge 3 commits into from

Conversation

neocoin
Copy link

@neocoin neocoin commented Apr 6, 2021

#2173 After 1.5.0 , 'route_setting :custom , key: :value' is broken with 'mount'.

check plz. @dblock

ps. I always thank you for grape.

@grape-bot
Copy link

grape-bot commented Apr 6, 2021

2 Warnings
⚠️ There're library changes, but not tests. That's OK as long as you're refactoring existing code.
⚠️ Unless you're refactoring existing code or improving documentation, please update CHANGELOG.md.

Here's an example of a CHANGELOG.md entry:

* [#2174](https://github.com/ruby-grape/grape/pull/2174): [wip] fix same custom route_setting value ignoreing problem - [@neocoin](https://github.com/neocoin).

Generated by 🚫 Danger

@dblock
Copy link
Member

dblock commented Apr 6, 2021

Correct rubocop with rubocop -a

@dblock
Copy link
Member

dblock commented Apr 6, 2021

Next step is to bisect down to the commit that broke it, then we can narrow down a fix.

@neocoin
Copy link
Author

neocoin commented Apr 6, 2021

Oh I didn't read convention rules.
Passed rubocop and add another success spec.

@dblock
Copy link
Member

dblock commented Apr 6, 2021

Oh I didn't read convention rules.
Passed rubocop and add another success spec.

There are no convention rules! I'm just slowly nudging you to find the issue and write a fix :)

@@ -30,7 +30,7 @@ def inherited(api, base_instance_parent = Grape::API::Instance)
# an instance that will be used to create the set up but will not be mounted
def initial_setup(base_instance_parent)
@instances = []
@setup = Set.new
Copy link
Author

Choose a reason for hiding this comment

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

Check plz @jylamont

@neocoin neocoin changed the title Test for route_setting duplication with mount. Fix same custom route_setting value ignoreing problem Apr 16, 2021
@dblock
Copy link
Member

dblock commented Apr 16, 2021

Because #2102 actually did address a memory leak I think we need to find another solution :(

@neocoin neocoin changed the title Fix same custom route_setting value ignoreing problem [WIP] Fix same custom route_setting value ignoreing problem Apr 19, 2021
@neocoin
Copy link
Author

neocoin commented Apr 20, 2021

@dblock
I almost understand about problem.

hm.. bad situation. I try to apply some solutions but I failed.

Basically, '@setup = Set.new' break stackable setting concept of grape

I can't find solution that classify always stackable DSL( desc, route_setings, get by code context ) and non-stackable DSL (logger with nil arguments, top_level_setting etc) at runtime after declarative initilization.

on https://github.com/ruby-grape/grape/blob/master/lib/grape/api.rb#L42

Do you have any idea?

@dblock
Copy link
Member

dblock commented Apr 20, 2021

You probably undertstand more than me now ;) Maybe we can split setup that needs to be retained and setup that doesn't? Anyone else has any ideas?

@neocoin
Copy link
Author

neocoin commented Apr 12, 2022

Too old. Sorry I changed interface to GraphQL. I don't maintain this branch

@neocoin neocoin closed this Apr 12, 2022
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.

3 participants