Skip to content

Dev/andres/master favorite services changes#27

Merged
dkmstr merged 2 commits intomasterfrom
dev/andres/master-favorite-services-changes
Mar 23, 2026
Merged

Dev/andres/master favorite services changes#27
dkmstr merged 2 commits intomasterfrom
dev/andres/master-favorite-services-changes

Conversation

@aschumann-virtualcable
Copy link
Contributor

Problem

Favoriting a service pool was silently ignored when the user had never used that service (i.e., no associated UserService). The action view attempted to resolve a UserService first and only proceeded if it existed. For services with in_use: false, no UserService is created, so the favorite action was never executed. The request still returned HTTP 200 with an empty body, resulting in no visible feedback on the frontend.

Root cause

The favorite/unfavorite logic was incorrectly dependent on the existence of a UserService, even though this operation only requires the service pool identifier.

Fix

Refactored uds/web/views/service.py (action function) to handle favorite and unfavorite actions before attempting to resolve a UserService.

  • Extract the pool UUID directly from service_id (F<uuid> / M<uuid>).
  • Call request.user.add_favorite() / remove_favorite() immediately.
  • Return early, avoiding any dependency on UserService.

Removed the duplicated favorite/unfavorite handling that previously occurred after the UserService lookup.

Why it worked for in-use services

When a service was already in use, a UserService existed, so the lookup succeeded and the favorite was applied using userservice.service_pool.uuid. For unused services, the lookup returned None, causing the logic to be skipped entirely.


Additional changes

Translations and UI text

  • Added new strings (cookies, login, service actions, UI elements).
  • Reorganized and clarified existing entries in translations-fakejs.js.

Code cleanup

  • Removed dead/commented code.
  • Standardized HTTP responses for better consistency.

Updates modern frontend dependencies and UI layout

Refreshes polyfills and scripts to improve compatibility.
Refactors main JavaScript logic and streamlines translations.
Adjusts styles and HTML structure for enhanced consistency
and maintainability across the modern user interface.
@dkmstr dkmstr merged commit d1ad7cc into master Mar 23, 2026
6 checks passed
@aschumann-virtualcable aschumann-virtualcable deleted the dev/andres/master-favorite-services-changes branch March 26, 2026 10:49
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.

2 participants