Skip to content

fix(code): show user's cloud-only tasks in desktop sidebar#2119

Draft
joshsny wants to merge 1 commit intomainfrom
posthog-code/show-cloud-tasks-without-workspace
Draft

fix(code): show user's cloud-only tasks in desktop sidebar#2119
joshsny wants to merge 1 commit intomainfrom
posthog-code/show-cloud-tasks-without-workspace

Conversation

@joshsny
Copy link
Copy Markdown
Contributor

@joshsny joshsny commented May 10, 2026

Problem

Tasks triggered via Slack (or any other cloud-only path) didn't appear in the
desktop sidebar until the user opened them in the web UI first — at which
point a local workspace got created as a side effect and the task suddenly
showed up.

The mobile app doesn't have this papercut because it lists tasks via
getTasks({ createdBy: <me> }). The desktop instead only fetched task
summaries for IDs it already knew about locally — local workspaces, pins,
or in-flight provisioning — and gated visibility on the same set:

// apps/code/src/renderer/features/sidebar/hooks/useSidebarData.ts
rawTasks.filter(
  (task) =>
    !archivedTaskIds.has(task.id) &&
    (showAllUsers ||
      showInternal ||
      !!workspaces?.[task.id] ||
      provisioningTaskIds.has(task.id)),
)

A Slack-launched cloud run is created server-side, has no local workspace on
the user's machine, and isn't in any of the other local sets — so it failed
the filter (and wasn't even fetched in the first place).

Changes

In useSidebarData:

  • Always fetch the user's own tasks via useTasks({ showAllUsers: false })
    (which already passes createdBy: <me>), enabled whenever we know the
    current user.
  • Merge those into rawTasks alongside the existing workspace/pin/provisioning
    summaries, deduped by id. Summary IDs that overlap with the user's task list
    are dropped from the summaries fetch so we don't request the same task twice.
  • Admit user-created tasks past the sidebar filter.
  • The showAllUsers (dev) and showInternal (staff) toggles keep using the
    full /tasks/ list as before.

How did you test this?

  • pnpm --filter=@posthog/code typecheck — no new errors in the changed file
    (the pre-existing missing-@posthog/git / @posthog/platform package errors
    are unrelated and present on main).
  • Biome check clean on the changed file.

Manual verification still pending — would appreciate a quick end-to-end check
of:

  1. Trigger a task from Slack while desktop is open → it should now appear in
    the sidebar without first opening the web UI.
  2. Existing local-workspace tasks created by collaborators still show up.
  3. The showAllUsers and showInternal (staff/dev) toggles behave as before.

Publish to changelog?

no


Created with PostHog Code

The desktop sidebar was scoping its fetch to tasks the user has a local
workspace, pin, or active provisioning for. Tasks created via Slack (or
any other cloud-only entry point) never satisfied that filter, so they
stayed invisible in the desktop until the user opened them in the web
UI first — at which point a workspace got created locally as a side
effect.

Now the sidebar also fetches the user's own tasks via the
`createdBy=<me>` path that mobile already uses, merges them with the
existing workspace/pin/provisioning summaries (deduped by id), and
admits user-created tasks past the visibility filter.

Generated-By: PostHog Code
Task-Id: 74e299ad-50ac-4583-a86d-d14a3bd5d4cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant