Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Clockify Node): Partial clockify trigger fix plus workaround #10803

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wsdevv
Copy link

@wsdevv wsdevv commented Sep 12, 2024

Summary

Fixes some aspects of the "new time entry" clockify trigger, as well as adding support for periodically fetching all entries for entry updating workaround.

Problem: This issue stems from a fundamental problem within the Clockify API, which does not allow access to most recent time entry submissions by date submitted (or finalized/created or stopped). Furthermore, Clockify only allows one to retrieve entries through start date (registered by the user) and end date (also inputted by the user) [plus a bit more irrelevant options]. The prior code seemed to have been treating the "start date" as submission/stop/finalization date (that's at least what it looks like, not sure if it was intentional), which caused problems such as discarding entries that have start dates prior to the latest checked date (so if it checked a minute ago, it would only fetch items from the current minute, then move onto the next minute).

Solution: Only set the "last checked"/"lastTimeChecked" variable when data is retrieved, then update the "lastTimeChecked" to the current time to skip already processed data. However, this doesn't update or account for modifications and/or additions after the "last checked" time is updated. This is why the new feature for polling all events is added, to support updating previous records, etc, though costly (meant to be used along with the fixed "new time entry" trigger, except at a slower interval).

Purpose: To put into place a system that gives a real time "feel" to clockify API updates while not requiring the use of webhooks and port forwarding. (this is useful for home servers)

Illustrations:
note: I use task and time entry interchangeably here

Previous method

image

New method

image

Update/manual insert workaround

image

Related Linear tickets, Github issues, and Community forum posts

Community post

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created. (In progress)
  • Tests included. (In progress)
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported) N/A

@CLAassistant
Copy link

CLAassistant commented Sep 12, 2024

CLA assistant check
All committers have signed the CLA.

@n8n-assistant n8n-assistant bot added community Authored by a community member node/improvement New feature or request in linear Issue or PR has been created in Linear for internal review labels Sep 12, 2024
@Joffcom
Copy link
Member

Joffcom commented Sep 12, 2024

Hey @wsdevv,

Thanks for the PR, We have created "GHC-228" as the internal reference to get this reviewed.

One of us will be in touch if there are any changes needed, in most cases this is normally within a couple of weeks but it depends on the current workload of the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Authored by a community member in linear Issue or PR has been created in Linear for internal review node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants