Skip to content

Fix Google Tasks create task success handling - #29030

Merged
raycastbot merged 2 commits into
raycast:mainfrom
mralonsocorona:fix-google-tasks-create-task
Jun 26, 2026
Merged

raycastbot merged 2 commits into
raycast:mainfrom
mralonsocorona:fix-google-tasks-create-task

Conversation

@mralonsocorona

Copy link
Copy Markdown
Contributor

Summary

Fixes the Google Tasks Create Task command so it only shows the success toast and closes the form after the task creation request has completed successfully.

Previously, the form called the async onCreate handler without awaiting it, then immediately showed Task Created! and navigated back. If the Google Tasks API request failed, users could still see a success message even though the task was not created.

Changes

  • Make the create form onCreate contract async.
  • Await task creation before showing the success toast.
  • Keep the form open and show a failure toast if creation fails.
  • Refresh the task list after successful creation from list views.
  • Add a changelog entry.

Validation

  • npm run lint
  • npm run build

Fixes #28900

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: google-tasks Issues related to the google-tasks extension platform: macOS platform: Windows labels Jun 25, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @elliotdes @pernielsentikaer @erikvdp @ridemountainpig 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="fix-google-tasks-create-task"
FORK_URL="https://github.com/mralonsocorona/extensions.git"
EXTENSION_NAME="google-tasks"
REPO_NAME="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 15 business days.

@greptile-apps

greptile-apps Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes Google Tasks task creation feedback so success is shown only after the API request completes. The main changes are:

  • Makes the create form onCreate handler async.
  • Awaits task creation before showing the success toast and closing the form.
  • Keeps the form open and shows a failure toast when creation fails.
  • Refreshes list views after successful task creation.
  • Adds a changelog entry.

Confidence Score: 4/5

The create-task success handling is improved, but the list refresh path still needs attention before merging.

The changed flow is small and focused, with validation reported, and runtime evidence confirms the remaining refresh regression in the filtered list view.

extensions/google-tasks/src/components/ListView.tsx and extensions/google-tasks/CHANGELOG.md

T-Rex T-Rex Logs

What T-Rex did

  • **Verification: Preserve active filter refresh**

  • **Result**: Reproduced

  • Executed a focused runtime harness that models ListView with the active filter set to All and mocked Google Tasks responses.

  • The initial load called fetchList with showCompleted=true and rendered both an open task and a completed task.

  • The create path succeeded, then refreshed with fetchList(listId) using the default showCompleted=false.

  • After the refresh, the completed task disappeared while the filter remained All.

  • Before: trex-artifacts/create-success-await-01-before.log shows base calls event:showToast and event:pop immediately after event:onCreate and before event:beforeResolve, with onSubmit returning undefined.

  • After: trex-artifacts/create-success-await-02-after.log shows head returns a promise, reaches event:beforeResolve with no success/pop yet, then after resolving onCreate emits event:showToast and event:pop.

  • This satisfies the requested contract: success toast and form close occur only after task creation completes successfully on head.

  • Before: trex-artifacts/create-failure-handling-01-before.log shows SHOW_TOAST {"style":"success","title":"Task Created!"}, POP_CALLED, and UNHANDLED_REJECTION Error: forced google api failure.

  • After: trex-artifacts/create-failure-handling-02-after.log shows SHOW_TOAST {"style":"failure","title":"Failed to create task"}, SUBMIT_RETURNED promise, and FINAL_EVENTS with pops:0.

  • Both command captures include command, working directory, and exit code, and both exited 0 after capturing the expected behavior.

  • Before: base shows success toast and navigation pop at steps 8-9 before createTask resolves, fetchList is called, or list state is refreshed at steps 10-15.

  • After: head shows createTask resolve, fetchList call/resolve, and refreshed state at steps 8-13 before success toast and navigation pop at steps 14-15.

View all artifacts

T-Rex Ran code and verified through T-Rex

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/google-tasks/src/components/ListView.tsx:50
**Preserve active filter refresh**
`fetchList(listId)` defaults `showCompleted` to `false`, so creating a task while the list filter is `All` reloads `state.tasks` without completed tasks. The initial load passes `showCompleted` based on `state.filter`; this refresh needs the same argument or completed tasks disappear from the current view after a successful create.

```suggestion
        const showCompleted = state.filter === Filter.All || state.filter === Filter.Completed;
        const refreshedList = await fetchList(listId, showCompleted);
```

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

@0xdhrv 0xdhrv self-assigned this Jun 26, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

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 943fa02 into raycast:main Jun 26, 2026
1 check passed
@github-actions

Copy link
Copy Markdown
Contributor

@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.

try {
setState((previous) => ({ ...previous, isLoading: true }));
await createTask(listId, taskToCreate);
const refreshedList = await fetchList(listId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Preserve active filter refresh
fetchList(listId) defaults showCompleted to false, so creating a task while the list filter is All reloads state.tasks without completed tasks. The initial load passes showCompleted based on state.filter; this refresh needs the same argument or completed tasks disappear from the current view after a successful create.

Suggested change
const refreshedList = await fetchList(listId);
const showCompleted = state.filter === Filter.All || state.filter === Filter.Completed;
const refreshedList = await fetchList(listId, showCompleted);
Artifacts

Repro: focused ListView create refresh harness

  • Contains supporting evidence from the run (text/javascript; charset=utf-8).

Repro: harness output showing omitted showCompleted refresh and disappearing completed task

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/google-tasks/src/components/ListView.tsx
Line: 50

Comment:
**Preserve active filter refresh**
`fetchList(listId)` defaults `showCompleted` to `false`, so creating a task while the list filter is `All` reloads `state.tasks` without completed tasks. The initial load passes `showCompleted` based on `state.filter`; this refresh needs the same argument or completed tasks disappear from the current view after a successful create.

```suggestion
        const showCompleted = state.filter === Filter.All || state.filter === Filter.Completed;
        const refreshedList = await fetchList(listId, showCompleted);
```

How can I resolve this? If you propose a fix, please make it concise.

almatkai pushed a commit to almatkai/raymes-extensions that referenced this pull request Jul 13, 2026
* Fix Google Tasks create task success handling

* Update CHANGELOG.md

---------

Co-authored-by: raycastbot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: google-tasks Issues related to the google-tasks extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Google Tasks] "Create Task" command fails

3 participants