godbout / alfred-time

Start and stop tracking time with Toggl, Harvest, Everhour or Clockify through Alfred 4. ⏰️
MIT License
110 stars 8 forks source link

Harvest Config Error #19

Closed caudillmiller closed 5 years ago

caudillmiller commented 6 years ago

I've setup the config file to use Harvest to run my timer, but it fails to load my projects. I receive this error when running debug mode.

[ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:
Warning: Invalid argument supplied for foreach() in Harvest.php on line 129
{"items":[{"arg":"{\"action\":\"choose_project\",\"query\":\"Start primary service\",\"original_action\":\"start\",\"show\":\"project_list\",\"continue\":true,\"project_ids\":[]}","subtitle":"Timer will be created without a project","title":"No project","type":"default","valid":true}]}

I also notice that the config file in your Readme.md is different from the one included in the current Release. I attempted to update the config file to match the walk-through file, but that did not resolve the issue. image 2017-11-28 at 1 07 50 pm

Seems like a great workflow for Alfred! I'm excited to use it.

godbout commented 6 years ago

Hello! I'll have a look this week. Thanks for reporting and thanks for all the info, gonna help a lot.

caudillmiller commented 6 years ago

No worries. Let me know if you need any other information.

godbout commented 6 years ago

@caudillmiller, do you mind trying something?

Set your domain and api_token in the config file, run "time sync", and try to start a timer. If harvest was set as active but got wrong credentials, the file cached is invalid. Be careful when copying the api_token, under certain circumstances (containing some characters like forward slash) your editor might not copy till the end of the line.

It doesn't seem to be a problem with the code itself (although I should handle better if wrong credentials are given at first), but I'm gonna push a new release that contain smaller icons, and a bunch of test files not needed. You can grab it also if you want.

Let me know!

godbout commented 6 years ago

Oh btw for the screenshots, it's just that I didn't redid them, but the README contains the new structure explanation.

gnapse commented 6 years ago

How can I run it in debug mode and get the output feedback shown above? I'm having a similar issue here (the workflow is not showing me the projects, even after having double checked my credentials and api token, and done the time sync thing). I'd like to be able to debug to see what's going on before raising an issue here.

gnapse commented 6 years ago

Sorry, I'm new to Alfred, I realized now that it's in Alfred where you enable debug mode for a workflow. I did that and I don't get anything relevant, no errors. I still don't get the list of projects. I'll open a separate issue to talk about it.

caudillmiller commented 6 years ago

@godbout sorry I haven't gotten back to you on this. I've been out of pocket with the holidays and such. I'll try Harvest this afternoon and let you know!

godbout commented 6 years ago

No worries. If you're still having issues you let me know, I'll try my best to get this solved quickly.

godbout commented 5 years ago

A year has passed.