Skip to content

Update awork extension#28337

Merged
raycastbot merged 3 commits into
raycast:mainfrom
Malte-Hypercode:ext/awork
May 27, 2026
Merged

Update awork extension#28337
raycastbot merged 3 commits into
raycast:mainfrom
Malte-Hypercode:ext/awork

Conversation

@Malte-Hypercode
Copy link
Copy Markdown
Contributor

@Malte-Hypercode Malte-Hypercode commented May 26, 2026

Description

Screencast

Checklist

- Merge branch \'fix-memory-issue\' into \'develop\'
- Add changelog
- Add token update via watcher
- Fix memeory issue
- Pull contributions
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: awork Issues related to the awork extension AI Extension platform: macOS platform: Windows OP is author The OP of the PR is the author of the extension labels May 26, 2026
@raycastbot
Copy link
Copy Markdown
Collaborator

raycastbot commented May 26, 2026

Thank you for your contribution! 🎉

🔔 @Malte-Hypercode 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 commands
BRANCH="ext/awork"
FORK_URL="https://github.com/Malte-Hypercode/raycast-extensions.git"
EXTENSION_NAME="awork"
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 dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@Malte-Hypercode Malte-Hypercode marked this pull request as ready for review May 26, 2026 13:16
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR replaces the previous self-revalidating onData/onError loop pattern with an event-driven approach: a lightweight onTokenChange pub/sub system in WebClient.ts triggers revalidate only when tokens actually change, avoiding the infinite-revalidation cycles that could occur when responses returned empty arrays. Retry logic with a 1-second back-off for 429 responses and normalization helpers for project/task objects are also added to FetchData.ts.

  • Token-change subscription (useEffect + onTokenChange) replaces the fragile onData/onError self-revalidation pattern across logTime.tsx, projects.tsx, and tasks.tsx.
  • Retry + delay logic in FetchData.ts now correctly classifies retryable errors (timeout, abort, network, 429, 5xx) and waits 1 second before re-issuing a rate-limited request.
  • normalizeProject / normalizeTask strip extraneous fields and supply safe defaults for optional nested objects before data reaches the cache.

Confidence Score: 5/5

The logic changes are well-scoped and fix a real revalidation-loop problem; the only issue is a cosmetic changelog date that should use the standard placeholder.

All functional changes are straightforward and improve existing behaviour. The token-change subscription is correctly cleaned up in useEffect, the retry delay is properly applied before re-issuing rate-limited requests, and the normalization helpers guard against missing nested fields. The only finding is the hardcoded date in CHANGELOG.md.

No files require special attention beyond swapping the hardcoded date in CHANGELOG.md for {PR_MERGE_DATE}.

Important Files Changed

Filename Overview
extensions/awork/CHANGELOG.md New entry uses a hardcoded date (2026-05-27) instead of the required {PR_MERGE_DATE} placeholder.
extensions/awork/src/composables/FetchData.ts Adds retry logic (MAX_REQUEST_RETRIES=1) with a 1-second delay for 429 responses, normalizes project/task objects before caching, and sets the HTTP status on thrown FetchErrors to enable accurate retry classification.
extensions/awork/src/composables/WebClient.ts Introduces a pub/sub token-change notification system (onTokenChange/notifyTokenChanged) called after both authorization and token refresh flows.
extensions/awork/src/logTime.tsx Replaces self-revalidating onData/onError loops with a useEffect subscription to onTokenChange, eliminating potential infinite-revalidation cycles on empty responses.
extensions/awork/src/projects.tsx Same token-change subscription pattern applied; removes the onData empty-check revalidation loop from the projects list command.
extensions/awork/src/tasks.tsx Same token-change subscription pattern applied; removes the onData empty-check revalidation loop from the tasks list command.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/awork/CHANGELOG.md:3
The new changelog entry uses a hardcoded date instead of the `{PR_MERGE_DATE}` placeholder required by the Raycast contribution guidelines. The merge date is automatically populated when the PR is merged — hardcoding today's date will leave the wrong release date in the changelog if the PR merges on a different day.

```suggestion
## [Improve stability] - {PR_MERGE_DATE}
```

Reviews (3): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

Comment thread extensions/awork/src/composables/FetchData.ts
…tatus codes

- Added a delayBeforeRetry function to introduce a 1-second wait before retrying requests that fail with a 429 status.
- Updated catch blocks in getProjects, getTasks, and getTypesOfWork to utilize the new delay function for improved error handling.
@pernielsentikaer pernielsentikaer self-assigned this May 27, 2026
Copy link
Copy Markdown
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot raycastbot merged commit f95d7c7 into raycast:main May 27, 2026
1 check passed
@github-actions
Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/hypercode/awork

@raycastbot
Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Extension extension: awork Issues related to the awork extension extension fix / improvement Label for PRs with extension's fix improvements OP is author The OP of the PR is the author of the extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants