fix: un-bookmark removes the task from the Favorites filter + grey filter star - EXO-88376 - #624
Merged
Jihed525 merged 1 commit intoJul 20, 2026
Conversation
…orite flag + refresh listener) + grey filter star - EXO-88376 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Jihed525
pushed a commit
that referenced
this pull request
Jul 21, 2026
…ws filtered tasks) - EXO-88376 (#628) Follow-up to #619/#624 addressing @jihed_chabbeh's report on [EXO-88376](https://community.exoplatform.com/portal/dw/tasks/taskDetail/88376): after a page **reload**, the "Favorites only" toggle is restored ON but the displayed list is not filtered (shows all tasks). ## Root cause In `TasksDashboard.vue` `created()`, `this.getTasksByPrimary(this.primaryFilter)` fires the initial `searchTasks()` **before** the persisted filters are restored from localStorage. `searchTasks()` reads `this.filterTasks`, whose `favorite` is still the default `false` at that moment; the persisted value is only restored a few lines later. So the toggle ends up ON while the initial `/tasks/filter` request went out with `favorite=` (empty) → unfiltered list. (The restored `groupBy`/`orderBy`/`showCompletedTasks` were also applied after the first fetch — same ordering flaw.) ## Fix Move the localStorage-restore block **above** `getTasksByPrimary(...)` in `created()`, so the first fetch honors the persisted filters. Confirmed the only primary filter on load is `ALL`, whose branch does not clobber `favorite` and re-reads `groupBy`/`orderBy` from the same key — so no regression to the date-primary filters (which force ungrouped and are only reached via toolbar events, never on load). `TasksViewDashboard.vue` (project view) needs no change — it does not persist the favorite filter (only group/order/completed), so it has no restore-on-reload mismatch. ## Verification Built the task WAR and verified live on a 7.3.x-ai-contribution build: with the favorites filter persisted, after a page reload the **initial** `GET /tasks/filter` now carries `favorite=true` (was `favorite=` before the fix) → the list is filtered from the first render. Front-end only, lint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Jihed525
added a commit
that referenced
this pull request
Jul 22, 2026
## What Backport of #619, #624, #628, #629 onto `develop`. Adds a **"Favorites only"** filter for tasks (follow-up to Favorites #615 / EXO-88316), with the fixes that followed after real-world testing: - **#619** — `favorite` query param on `GET /tasks/filter` (batched via `FavoriteService`) + a "Favorites only" toggle in the Sort & Filter drawer, persisted in localStorage. - **#624** — un-bookmarking a task now removes it from the favorites-filtered list immediately (list rows carry `favorite` state, front-end listens for `metadata.favorite.updated`); drawer star recolored to neutral grey. - **#628** — the persisted "Favorites only" toggle is now honored on the *first* fetch after a page reload in My Tasks (was previously applied only after the initial unfiltered fetch). - **#629** — same reload fix extended to the project/space board view, which #628 had missed. ## Backport notes Cherry-picked the 4 commits onto `develop`. Two conflicts, both resolved: - `TaskRestService.java`: import conflict (develop already had `FavoriteService` imported for an unrelated feature); also dropped a private `isFavorite(String, long)` helper introduced by #624 that duplicated `FavoriteUtil.isFavorite`, already present on `develop` since #622 (`Favorites for projects & tasks - EXO-88316`) — it was unused here since `getTaskById` on `develop` already goes through `FavoriteUtil`. - `TasksViewDashboard.vue`: #629's diff assumed `favorite` had been dropped from this file by an intermediate commit that only exists on `feature/ai-contribution`, not `develop` — on `develop` the field was already being carried through (from #619/#624), so the "fix" was already effectively in place; resolved by keeping upstream's exact wording where it was purely a stylistic difference (`!!x` vs `x || false`), for consistency. ## Test - `mvn -pl services -am -Dcheckstyle.skip=true -DskipTests install` → BUILD SUCCESS - `mvn -pl services -Dcheckstyle.skip=true -Dtest=TestTaskRestService test` → 20 tests, 0 failures/errors 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.



Follow-up to #619 (EXO-88376) addressing @Samuel.Renault's feedback on the "Favorites only" task filter.
Bugs
1. Un-bookmarking a task did not remove it from the favorites-filtered list — and it persisted after a full reload / filter reset.
Root cause was front-end, in two parts:
TaskRestService) did not setfavoriteon list rows (onlygetTaskByIddid). The 3-dots favorite menu then resolved the state lazily and, when stale/false, inverted the toggle toaddFavorite(POST) instead of DELETE — so the favorite was never removed and correctly persisted across reload.Fixes:
TaskRestService.filterTasks: compute the user's favorite task-id set once (batched viafavoriteService.getFavoriteItemsByCreatorAndType, reused for both filtering and flagging — no N+1) and setfavoriteon every returned row. Now the menu never guesses → un-bookmark always DELETEs. NewgetFavoriteTaskIdshelper.getTaskDetailsuntouched.TasksDashboard.vue/TasksViewDashboard.vue: listen formetadata.favorite.updatedand splice the un-bookmarked task out when the favorites filter is active (no-op otherwise).2. Favorite icon color. The drawer "Favorites only" star was a filled
fas fa-starwith no color (read as emphasized). Nowfar fa-star icon-default-color(neutral grey outline, matching the other filter rows). Bonus: the per-task menu active starwarning--text→ platform amberyellow--text text--darken-2.Verification
TestTaskRestServiceextended (rows come backfavorite=true/falsecorrectly) — green./tasks/filterrow carriesfavorite:true; un-bookmark →DELETE …/favorites/task/{id}(204) → a fresh/tasks/filter?favorite=true(= a full reload) returns empty, and the all-tasks row flips tofavorite:false. Front-end listener + grey star confirmed in the deployed bundles.🤖 Generated with Claude Code