Skip to main content

Module favorites

Module favorites 

Source
Expand description

Pushing favourite toggles made while the server was unreachable.

Favouriting works offline: storage_toggle_favorite writes the local user_data row and sets pending_sync = 1. Until DR-120 nothing ever cleared that flag — the offline mark_favorite/unmark_favorite are no-ops and syncService.queueFavorite had no callers — so an offline toggle was silently lost.

The drain lives in Rust, not the frontend, because it must run whether or not any view is mounted; a drain started by a component dies with it.

TRACES: UR-069 | DR-120 | UT-103

Structs§

PendingFavorite
A local favourite change still waiting to reach the server.

Traits§

FavoriteSink
The subset of the repository the drain needs.

Functions§

drain_pending_favorites
Push pending favourite changes to the server and clear their flags.
read_pending 🔒
Read every favourite change this user has pending.
run_drain 🔒
spawn_favorites_drain
Drain on every offline→online transition.