Git Product home page Git Product logo

toggl-to-clockify-cli's People

Contributors

genius69 avatar mikerourke avatar thornomad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

toggl-to-clockify-cli's Issues

Version error: v11.2.0

Just giving this a try for the first time -- not super familiar with node so apologies. Got this error right off the bat:

~ toggl-to-clockify init
You must be using Node.js v10.3 or greater
Your current version, v11.2.0, won't work

v11.2.0 would seem to be greater than v10.3 ... do I need to target a specific version?

Cannot read property 'name' of undefined when attempting transfer

Description

An error with message Cannot read property 'name' of undefined is being thrown when attempting to run the transfer command

Source

User emailed me with error details

Steps to Reproduce

  1. Ensure configuration file is present (run toggl-to-clockify init)
  2. Ensure the workspaces field in the configuration file is populated with valid values
  3. Run toggl-to-clockify transfer

Attachments

stack-trace

Infinite loop when transferring time entries to Clockify

Description

When running the toggl-to-clockify transfer command, the time entry transfer portion would continue running even though entries weren't being created

Source

User emailed me with error details

Steps to Reproduce

  1. Ensure configuration files is present (run toggl-to-clockify init)
  2. Ensure the workspaces field in the configuration file is populated with valid values
  3. Run toggl-to-clockify transfer

Throttle Toggl API calls

First of all, thanks for this awesome project!

One thing that needs to be taken care of is to add some throttling between calls to the Toggl API. If one has several pages of data the following error will be thrown when paging through Toggl entries:

(node:49735) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://toggl.com/reports/api/v2/details?workspace_id=123456&user_agent=john%40doe.com&page=29&since=2018-01-01&until=2018-10-15 reason: Unexpected token < in JSON at position 0
    at /Users/consulthys/workspaces/toggl-to-clockify/node_modules/node-fetch/lib/index.js:239:32
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:49735) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:49735) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is due to the fact that the Toggl API will return the following response if requests are not properly throttled:

<html>
<head><title>429 Too Many Requests</title></head>
<body bgcolor="white">
<center><h1>429 Too Many Requests</h1></center>
<hr><center>nginx</center>
</body>
</html>

We can see on lines 134-138 of Toggl.ts that all fetch calls go out at the same time, so it might be ok if one has only very few pages, but not otherwise.

Basically, the same way you did for the calls to the Clockify API using the pause function would be perfect.

UnhandledPromiseRejectionWarning: TypeError: results.reduce is not a function

Hello

During import data from Toggl I'm getting error:
(node:4726) UnhandledPromiseRejectionWarning: TypeError: results.reduce is not a function at Clockify.<anonymous> (/home/tj/.nvm/versions/node/v11.11.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:518:44) at step (/home/tj/.nvm/versions/node/v11.11.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:43:23) at Object.next (/home/tj/.nvm/versions/node/v11.11.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:24:53) at fulfilled (/home/tj/.nvm/versions/node/v11.11.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:15:58) at processTicksAndRejections (internal/process/next_tick.js:81:5) (node:4726) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:4726) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Refactor from by tool to by entity

Overview

Change code structure/functionality to be split up by entity, rather than tool.

Reasoning

It will make the codebase easier to test and manage. It also allows for incremental updates (e.g. the tool will still work with just projects, tasks, time entries, etc., but users can be added without breaking anything).

It will also address #7 and accommodate for teams.

Entity List

The following entities are shared between Clockify and Toggl, and should be relatively easy to implement:

  • Client
  • Project
  • Report
  • Tag
  • Task
  • Time entry
  • User
  • User group
  • Workspace

Toggl also includes the concept of Project and Workspace users, which will need to be included in the corresponding entity class.

Seems broken, gets stuck

Screenshot

โ‡’  toggl-to-clockify transfer
Fetching workspaces from Toggl...
Fetching time entries and projects in workspace: Default...
Getting time entries for page 1 for Default for the year of 2018...
Getting time entries for page 2 for Default for the year of 2018...
Getting time entries for page 1 for Default for the year of 2019...
Getting time entries for page 2 for Default for the year of 2019...
Getting time entries for page 3 for Default for the year of 2019...
Writing Toggl data to JSON file...
Toggl processing complete
Fetching workspaces from Clockify...
Getting clients for Default...
Getting projects for Default...
Getting tags for Default...
Transferring clients to Clockify in Default...
Transferring projects to Clockify in Default...
Transferring tags to Clockify in Default...
Transferring time entries to Clockify in Default...
Creating time entries for records 0 - 25...
Creating time entries for records 25 - 50...
Creating time entries for records 50 - 75...
Creating time entries for records 75 - 100...
Creating time entries for records 100 - 125...
Creating time entries for records 125 - 150...
Creating time entries for records 150 - 175...
Creating time entries for records 175 - 200...```

There's nowhere near this many entries, I started trying toggle last week.

{
  "email": "REDACTED@REDACTED",
  "togglApiToken": "REDACTED",
  "clockifyApiToken": "REDACTED",
  "workspaces": [
    {
      "name": "Default",
      "years": [2018, 2019]
    }
  ]
}

UnhandledPromiseRejectionWarning messages

Hi, Im trying to migrate my companies data/hours etc from Toggl to Clockify. Ive followed the instructions you provided but I get the following...

Fetching workspaces from Toggl...
(node:14678) UnhandledPromiseRejectionWarning: TypeError: Symbol.asyncIterator is not defined.
at __asyncGenerator (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:50:38)
at Toggl.getWorkspaceDetailsIteratable (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:387:16)
at Toggl. (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:463:49)
at step (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:43:23)
at Object.next (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:24:53)
at fulfilled (/usr/local/lib/node_modules/toggl-to-clockify/lib/tools/Toggl.js:15:58)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:14678) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14678) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any ideas, please?

UnhandledPromiseRejectionWarning when transferring clients to Clockify

After running toggl-to-clockify transfer -c t2c.json, I get an UnhandledPromiseRejectionWarning when transferring clients to Clockify. Output below.

Node version: 11.5.0.
More information: my Clockify is completely empty as of now, while my Toggl has hundreds of time entries and many different projects.
This bug was mentioned in a comment in issue #12 . Any simple fix?
Thanks,
~Yuval

Fetching time entries and projects in workspace: Yuvalgat11...
Getting time entries for page 1 for Yuvalgat11 for the year of 2018...
Getting time entries for page 2 for Yuvalgat11 for the year of 2018...
Getting time entries for page 3 for Yuvalgat11 for the year of 2018...
Getting time entries for page 4 for Yuvalgat11 for the year of 2018...
Getting time entries for page 5 for Yuvalgat11 for the year of 2018...
Getting time entries for page 6 for Yuvalgat11 for the year of 2018...
Getting time entries for page 7 for Yuvalgat11 for the year of 2018...
Getting time entries for page 8 for Yuvalgat11 for the year of 2018...
Getting time entries for page 9 for Yuvalgat11 for the year of 2018...
Getting time entries for page 10 for Yuvalgat11 for the year of 2018...
Getting time entries for page 11 for Yuvalgat11 for the year of 2018...
Getting time entries for page 12 for Yuvalgat11 for the year of 2018...
Getting time entries for page 13 for Yuvalgat11 for the year of 2018...
Getting time entries for page 14 for Yuvalgat11 for the year of 2018...
Getting time entries for page 15 for Yuvalgat11 for the year of 2018...
Getting time entries for page 16 for Yuvalgat11 for the year of 2018...
Getting time entries for page 17 for Yuvalgat11 for the year of 2018...
Getting time entries for page 18 for Yuvalgat11 for the year of 2018...
Writing Toggl data to JSON file...
Toggl processing complete
Fetching workspaces from Clockify...
Getting clients for Yuvalgat11...
Getting projects for Yuvalgat11...
Getting tags for Yuvalgat11...
Transferring clients to Clockify in Yuvalgat11...
(node:34957) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'filter' of null
    at Clockify.<anonymous> (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:300:63)
    at step (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:43:23)
    at Object.next (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:24:53)
    at /Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:14:12)
    at Clockify.transferEntitiesFromToggl (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:293:16)
    at Clockify.<anonymous> (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:407:41)
    at step (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:43:23)
    at Object.next (/Users/yuvalgat/.nvm/versions/node/v11.5.0/lib/node_modules/toggl-to-clockify/lib/tools/Clockify.js:24:53)
(node:34957) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:34957) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In thefuture, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.