Skip to content

[Fix] Wishlist filter on Deals screen leaves no way out (#5588)#5602

Open
flavioislima wants to merge 3 commits into
mainfrom
fix/wishlist_filter
Open

[Fix] Wishlist filter on Deals screen leaves no way out (#5588)#5602
flavioislima wants to merge 3 commits into
mainfrom
fix/wishlist_filter

Conversation

@flavioislima

@flavioislima flavioislima commented May 23, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #5588.

  • Backend now exposes a dedicated getGogWishlist IPC handler that returns the user's GOG wishlist product IDs (fetched from embed.gog.com/user/wishlist.json).
  • getGogDiscounts no longer accepts/forwards wishlistOnly; the discount list is always the full sale catalog.
  • The Deals screen applies "Wishlist Only" as a client-side filter against the wishlist IDs, the same way hideDlcs, genres, etc. work — toggling it never re-fetches the catalog.
  • The filters bar now renders whenever filters are active even if no products match, so the user can always untoggle "Wishlist Only" (or any other filter) and the empty-state message lives inside the list area.
  • "Wishlist Only" and "Hide Owned" checkboxes were already hidden in the filter bar when logged out, but their persisted state from a previous session still drove filtering and triggered an authenticated refetch the backend couldn't fulfill. Both are now ignored at the filter/refetch level whenever the user is signed out of GOG, while the preference is preserved for the next login.

Why

Previously, toggling "Wishlist Only" triggered a backend refetch with wishlist=eq:true. If the user had nothing in their wishlist on sale, GOG returned zero products, the filters bar (rendered only when products.length > 0) disappeared, and the user was stuck on an empty page until they changed the store region to force a different fetch.

Test plan

  • Logged into GOG with a wishlist that has no items on sale → toggle "Wishlist Only" → empty-state message appears inside the list and the filter bar (with the checkbox) stays visible so the user can untoggle.
  • Logged into GOG with at least one wishlisted item on sale → toggle "Wishlist Only" → only wishlisted items render; toggling off restores the full list without a network refetch.
  • Logged into GOG → toggling "Hide Owned" still triggers a refetch as before (unchanged).
  • Signed out of GOG → "Wishlist Only" and "Hide Owned" checkboxes are not visible, full sale catalog renders, and the backend is not called with hideOwned=true even if a previous logged-in session left those toggles on.
  • Toggle either filter on while logged in → sign out → sign back in → the previously-toggled preference is restored.

Add a new getGogWishlist IPC handler that returns the user's wishlist
product IDs from embed.gog.com, and drop the wishlist=eq:true query from
getGogDiscounts. The frontend will now apply the wishlist filter against
the locally fetched product list instead of re-fetching from GOG, which
prevents the deals grid from emptying when nothing in the wishlist is on
sale.
…5588)

Apply wishlistOnly as a client-side filter using the IDs fetched from the
new getGogWishlist endpoint, and render the filter bar whenever filters
are active even if no products match. Previously, toggling "Wishlist
only" triggered a backend refetch that wiped the products list and hid
the filter bar entirely, leaving the user no way to untoggle without
changing the store region.
Both checkboxes are already hidden from the filter bar when the user is
not signed in, but their persisted localStorage state still drove the
filtering and the discounts refetch. That caused two confusing outcomes
after logging out: the grid could appear empty for no visible reason,
and getGogDiscounts was called with hideOwned=true which the backend
silently turns off — adding noise to the logs. Treat both toggles as
off whenever isGogLoggedIn is false while preserving the underlying
preference for the next login.
@flavioislima flavioislima requested review from a team, CommandMC, Etaash-mathamsetty, arielj, biliesilva and imLinguin and removed request for a team May 23, 2026 10:47
@flavioislima flavioislima added the pr:ready-for-review Feature-complete, ready for the grind! :P label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:ready-for-review Feature-complete, ready for the grind! :P

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cant exit Whishlist Filter on Deals screen

1 participant