productiveio/api_client

Version 0.6.43 breaks when fetching Bookings

Closed this issue · 1 comments

We have a small app that uses this gem to fetch and write Bookings from and to our Productive account.

Recently it started breaking on queries such as

Productive::Booking.where(project_id: PROJECT_ID, after: DATE).all

The error is:

NameError: uninitialized constant Productive::Booking::Workflow

The stack trace

/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/utils.rb:24:in `compute_type'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/included_data.rb:9:in `block in initialize'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/included_data.rb:8:in `each'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/included_data.rb:8:in `inject'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/included_data.rb:8:in `initialize'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:97:in `new'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:97:in `handle_included'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:18:in `block in parse'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:8:in `tap'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:8:in `parse'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/query/requestor.rb:60:in `request'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/query/requestor.rb:27:in `get'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/json_api_client-1.5.2/lib/json_api_client/query/builder.rb:100:in `find'
/home/runner/work/support-rota-to-productive/support-rota-to-productive/vendor/bundle/ruby/2.7.0/gems/productive-0.6.43/lib/json_api_query_builder.rb:4:in `all'

It's not the first time when it seems like adding a new resource to the API breaks things for users of the gem, until the gem defines those resources and a new version is released.

Eagerly awaiting 0.6.44!

Thank you.

Hey,

Version 0.6.44 of the gem is already published and this should be fixed there.

We do know about this issue when we create new resources. But we have a hard time figuring out how to make it work dynamically inside the json_api_client gem. We'll let you know if we have any new breakthroughs.