ForestAdmin / forest-rails

💎 Ruby on Rails agent for Forest Admin to integrate directly to your existing Ruby on Rails backend application.
https://www.forestadmin.com
GNU General Public License v3.0
374 stars 77 forks source link

Issue with groupdate gem dependency upgrade #344

Closed lostie closed 4 years ago

lostie commented 4 years ago

Expected behavior

No exceptions raised.

Actual behavior

The major version upgrade of groupdate gem from 4.3.0 to 5.0.0 is causing some exceptions when interacting with ForestAdmin.

Failure Logs

Screenshot 2020-02-24 at 09 54 51

Context

arnaudbesnier commented 4 years ago

Thanks @lostie , Could you detail precisely what kind of interaction or API call raise those exceptions?

lostie commented 4 years ago

@arnaudbesnier Sorry for having taken this long to come back to you.

The exception occurs while loading the Dashboard, here's some more info:

Started POST "/forest/stats/Customer"
Processing by ForestLiana::StatsController#get as HTML
  Parameters: {"type"=>"â– ", "collection"=>"â– ", "timezone"=>"â– ", "aggregate"=>"â– ", "time_range"=>"â– "}
ArgumentError (unknown keywords: week_start)
unknown keywords: week_start excluded from capture: DSN not set
Screenshot 2020-03-18 at 11 04 55
arnaudbesnier commented 4 years ago

Hi @lostie, so it might be due to a conflict between the groupdate gem version that the liana is using (v2.5.2) et the one you use for your own codebase.

It was apparently not an issue with your groupdate@4.3.0 gem but the v5 might introduce breaking changes that broke Forest Admin Time based charts.

arnaudbesnier commented 4 years ago

The patch is available in the new version 5.1.1. Thanks for your patience.

🌲🌲🌲

lostie commented 3 years ago

@arnaudbesnier After upgrading to forest_Liana version 6.3.5, I'm experiencing issues still related with groupdate:

ArgumentError","message":"wrong number of arguments (given 3, expected 2)

I'lll leave the stacktrace here for reference:

/app/vendor/bundle/ruby/3.0.0/gems/groupdate-5.2.2/lib/groupdate/query_methods.rb:13:in `group_by_period'
/app/vendor/bundle/ruby/3.0.0/gems/groupdate-5.2.2/lib/groupdate/enumerable.rb:8:in `block (3 levels) in <module:Enumerable>'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.3.2/lib/active_record/relation.rb:406:in `block in scoping'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.3.2/lib/active_record/relation.rb:810:in `_scoping'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.3.2/lib/active_record/relation.rb:406:in `scoping'
/app/vendor/bundle/ruby/3.0.0/gems/groupdate-5.2.2/lib/groupdate/enumerable.rb:8:in `block (2 levels) in <module:Enumerable>'
/app/vendor/bundle/ruby/3.0.0/gems/forest_liana-6.3.5/app/services/forest_liana/line_stat_getter.rb:34:in `perform'
/app/vendor/bundle/ruby/3.0.0/gems/forest_liana-6.3.5/app/controllers/forest_liana/stats_controller.rb:41:in `get'
arnaudbesnier commented 3 years ago

Hi @lostie, it might be related to this contribution: https://github.com/ForestAdmin/forest-rails/pull/454

Can you test if the version 6.3.3 is working as expected on your project?

jeffladiray commented 3 years ago

Hi @lostie,

It is most likely related to #454, but I'm currently not able to reproduce. Would it be possible to have more insights of this issue please :pray: (Maybe a loom video or the failing chart configuration would help)

Thanks.

lostie commented 3 years ago

Hi @lostie, it might be related to this contribution:

454

Can you test if the version 6.3.3 is working as expected on your project?

We were already on 6.3.3 before attempting to upgrading 6.3.5 and didn't experience the issue reported until we upgraded to this latest version.