feat: sync task pins with PostHog - #3925
Merged
Merged
Conversation
|
😎 Merged successfully - details. |
|
React Doctor could not produce a report. Reviewed by React Doctor for commit |
tatoalo
marked this pull request as ready for review
July 29, 2026 11:03
Contributor
Prompt To Fix All With AI### Issue 1
packages/ui/src/features/sidebar/usePinnedTasks.ts:11-15
**Pins cache crosses identities**
When a user logs out, changes projects, or switches organizations, this static query remains cached because it lacks authentication-scoped metadata and an authentication guard. The sidebar therefore displays the previous identity's pins, or the unauthenticated empty result, for up to the 30-second stale period.
### Issue 2
packages/ui/src/features/sidebar/taskMetaApi.ts:57-61
**Concurrent toggles collapse**
When the same task is toggled twice before the first GET-and-POST sequence finishes, both operations can read the same initial pin state and write the same value. Two user actions then produce only one persisted toggle, leaving the server state inconsistent with the user's final action.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix: route sidebar pins through PostHog" | Re-trigger Greptile |
tatoalo
force-pushed
the
posthog-code/sync-task-pins
branch
from
July 29, 2026 11:09
d763943 to
2348d61
Compare
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
Generated-By: PostHog Code Task-Id: a9750a18-8013-4b1f-ab40-d9999bba7144 fix: route sidebar pins through PostHog Generated-By: PostHog Code Task-Id: a9750a18-8013-4b1f-ab40-d9999bba7144 perf: avoid redundant task pin reads Generated-By: PostHog Code Task-Id: a9750a18-8013-4b1f-ab40-d9999bba7144 fix: scope and serialize task pin state Generated-By: PostHog Code Task-Id: a9750a18-8013-4b1f-ab40-d9999bba7144
tatoalo
force-pushed
the
posthog-code/sync-task-pins
branch
from
July 29, 2026 11:19
9aecbbb to
d54dfbb
Compare
jonathanlab
approved these changes
Jul 29, 2026
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
Task pins are currently stored per device, so they cannot be recovered when a user signs back in elsewhere.
Why: The pinned-task sidebar should reflect the authenticated user, not a particular installation or browser profile.
Changes
Depends on PostHog/posthog#74595