Skip to content

fix: apply impersonation filter to View Tasks As feature - #193

Open
waterWang wants to merge 1 commit into
donetick:developfrom
waterWang:fix/view-tasks-as-impersonation-filter
Open

fix: apply impersonation filter to View Tasks As feature#193
waterWang wants to merge 1 commit into
donetick:developfrom
waterWang:fix/view-tasks-as-impersonation-filter

Conversation

@waterWang

Copy link
Copy Markdown

Fix: View Tasks As impersonation filter not applied

Bug

When selecting "View Tasks As" from the UserSwitcher, the chores list was not filtering to only show tasks assigned to the selected user. The getFilteredChores useMemo in MyChores.jsx was using projectFilteredChores directly without applying the impersonation filter, causing all chores to remain visible regardless of the impersonated user selection.

Root Cause

The getFilteredChores function used projectFilteredChores (which only filters by project) as its base, missing the impersonation filter that was only applied in searchFilteredChores (from the useChoreFilters hook). Since getFilteredChores is the primary data source used for rendering the chores list, the impersonation filter was effectively bypassed.

Fix

Added impersonation filtering to getFilteredChores: when impersonatedUser is set, the chore list is filtered to only include chores where chore.assignedTo === impersonatedUser.userId. This mirrors the same logic already present in useChoreFilters.

Related issue

Closes donetick/donetick#501

@meauxt

meauxt commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution! Do you mind rebasing please? sorry I push somethng might conflicted with your changes

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.

[BUG] "View Tasks As" is broken on web app

2 participants