fabricio icon indicating copy to clipboard operation
fabricio copied to clipboard

I can't seem to get it to work fully

Open spidfire opened this issue 7 years ago • 7 comments

Hi, I've got some problems The total_sessions function returns nothing and after a bit hacking did I find the response which is: {"message":"App required."}

crashes seem to work correct

and top_issues has an internal response of {"errors":[{"message":"Internal error"}]}

Do you have any clues where I did go wrong?

My script:


require 'fabricio'

client = Fabricio::Client.new do |config|
    config.username = ENV["FABRIC_USER"]
    config.password = ENV["FABRIC_PASS"]
end
oneweek = 60*60*24*7
threeweeks = oneweek*3
now = Time.now.to_i

puts client.app.total_sessions(appid, (now-threeweeks).to_s, now.to_s, '8.8.2.0 (2030)')
puts client.app.crashes(appid, (now-threeweeks).to_s, now.to_s, ['8.8.2.0 (2030)'])
puts client.app.top_issues(appid, (now-threeweeks).to_s, now.to_s, ['8.8.2.0 (2030)'], 10)

spidfire avatar Jan 04 '18 16:01 spidfire

Same here, we are unable to compute the crashfree ratio because the total_sessions request is failing with the aforementioned error. Only some apps seem affected though 🤔 .

xavierjurado avatar Jan 10 '18 16:01 xavierjurado

hmm, :thinking: maybe because only some apps have stats(answers) enabled?

spidfire avatar Jan 10 '18 17:01 spidfire

As far as I can see all our apps have the same configuration in Fabric 😞 .

xavierjurado avatar Jan 10 '18 17:01 xavierjurado

Hmm found maybe something different. I've got 2 accounts and one is member of a sub organisation of the other. And I've got the feeling it has to do with that somewhere. (Ill continue investigating for now)

spidfire avatar Jan 10 '18 18:01 spidfire

You were right, as of now it seems fabricio does not support users with multiple organization. You can see the culprit of the problem in the AuthorizationClient.obtain_organization_id(auth_data) method: https://github.com/strongself/fabricio/blob/develop/lib/fabricio/authorization/authorization_client.rb#L118

We are storing the id of the first organization and ignoring the rest, and then using this identifier to build all the organization-related URL requests. The fix is non-trivial because I've not found a mapping for "organization - app", so we will need to fetch the details of an app (given its identifier) and extract its organization from there.

xavierjurado avatar Jan 11 '18 09:01 xavierjurado

Cool, maybe I will find some time to research this.

Another problem I've encountererd was that the top_issues is not working return contents from the graphql: {"errors":[{"message":"Internal error"}]}

The actual error: lib/fabricio/services/app_service.rb:168:in `top_issues': undefined method `[]' for nil:NilClass (NoMethodError)

spidfire avatar Jan 11 '18 10:01 spidfire

I've tried to fix this issue in #46, feel free to check my solution! @spidfire @CognitiveDisson

xavierjurado avatar Jan 14 '18 22:01 xavierjurado