fix(code): show user's cloud-only tasks in desktop sidebar#2119
Draft
fix(code): show user's cloud-only tasks in desktop sidebar#2119
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 tasksummaries for IDs it already knew about locally — local workspaces, pins,
or in-flight provisioning — and gated visibility on the same set:
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:useTasks({ showAllUsers: false })(which already passes
createdBy: <me>), enabled whenever we know thecurrent user.
rawTasksalongside the existing workspace/pin/provisioningsummaries, 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.
showAllUsers(dev) andshowInternal(staff) toggles keep using thefull
/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/platformpackage errorsare unrelated and present on
main).checkclean on the changed file.Manual verification still pending — would appreciate a quick end-to-end check
of:
the sidebar without first opening the web UI.
showAllUsersandshowInternal(staff/dev) toggles behave as before.Publish to changelog?
no
Created with PostHog Code