-
Notifications
You must be signed in to change notification settings - Fork 6
Prevent deep pagination causing Solr trouble #386
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
Conversation
Code quality scoreUh oh! The code quality got worse for this PR! Better take a look!! 🚨
|
app/models/supplejack_api/search.rb
Outdated
| **options.merge(model_class: klass.model_class, schema_class: klass.schema_class) | ||
| ) | ||
|
|
||
| @options = if options.present? && options['api_key'].present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to check the role of the key rather than if it is present or not, the anonymous user does actually have a key and it gets used if you don't provide your own key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this implementation if I knew the anonymous API key user (unlikely) I could get around it
richardmatthewsdev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be worth looking at the roles functionality that we can do in the record schema and see if there is a way that we can change the limits based on the role, rather than lack of the API key in the params :)
| s.add_dependency 'kaminari' | ||
| s.add_dependency 'kaminari-mongoid' | ||
| s.add_dependency 'lazy_high_charts' | ||
| s.add_dependency 'mimemagic' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Will this break anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hapiben it's a good question, but I couldn't even run bundle install unless I removed it
37bdca3 to
b2af788
Compare
Acceptance Criteria
Notes