-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[toggl-track] Use cache to avoid hitting API limits #24257
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
base: main
Are you sure you want to change the base?
Conversation
|
Thank you for your contribution! 🎉 🔔 @franzwilhelm @bkeys818 @michaelfaisst @teziovsky @tangerine1202 @AlexIsMaking @ARui-tw @pernielsentikaer @AdrianKokot @xmok you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="main"
FORK_URL="https://github.com/lukebars/raycast-extensions.git"
EXTENSION_NAME="toggl-track"
REPO_NAME="raycast-extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devDue to our current reduced availability, the initial review may take up to 10-15 business days. |
Greptile Summary
Important Files Changed
Confidence score: 2/5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (2)
-
extensions/toggl-track/src/api/timeEntries.ts, line 14-19 (link)logic: Cache key 'timeEntries' ignores function parameters (startDate, endDate, includeMetadata). Different date ranges will return stale cached data instead of fresh results. Consider using a dynamic cache key like
timeEntries-${startDate.toISOString()}-${endDate.toISOString()}-${includeMetadata} -
extensions/toggl-track/CHANGELOG.md, line 3 (link)syntax: The date should use the placeholder
{PR_MERGE_DATE}instead of a specific dateContext Used: Rule from
dashboard- What: Changelog entries must use{PR_MERGE_DATE}placeholder in titles, be placed at the top of th... (source)
10 files reviewed, 2 comments
|
Hi 👋 Thanks for your contribution 💪 Could you look into the suggestions from Greptile related to the cache key update? I'm looking forward to testing this extension again 🔥 I converted this PR into a draft until it's ready for the review, please press the button Feel free to contact me here or at Slack if you have any questions. |
Description
Starting September 5th, 2025 Toggl Track introduced API limits. Most of the users are using free plan, or starting premium plan which has very low API limits.
I've added cache utilisation to prevent menu bar from hitting the API limit as soon as it starts. Increased default cache time to 240 seconds. It is still configurable in the extension settings for those who want faster refresh rates. Right now the extension's menu bar function is finally usable again.
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool