Skip to content

Consolidate the two writers of account preferences behind one owner #104

Description

@Adron

Follow-up from #33 and #19, both of which needed the same account preference and deliberately did
not create a feature→feature dependency to get it.

Current state

Two independent paths now read and write PATCH /api/user/update:

  1. :feature:profileSettingsRepository (from Settings: View preferences (viewingPreference) and link previews (showPreviews) #33) — models all fifteen fields, backs the
    Settings screen, @Singleton with a process-scoped in-memory cache.
  2. :core:networkViewingPreferenceStore (from Feed: view preferences (All / My / Following / Followers) and onlyMine #19) — a narrow accessor for
    viewingPreference so :feature:messages can drive the feed switcher.

Each has its own in-flight state and neither knows about the other's writes.

User-visible symptom: change the view preference in Settings, and an already-composed feed
switcher still shows the old value until the feed screen is re-entered.

Why it happened

No feature module in this repo depends on another — that is a deliberate convention that keeps
modules conflict-free for parallel work. :feature:messages therefore could not read
:feature:profile's repository, and duplicating a narrow accessor in :core:network was the
smaller evil at the time.

What to do

Promote a single account-preferences owner — a :core:preferences (or similar) module holding the
UserSettings model, the partial-PATCH call and one observable cache — and have both
:feature:profile's Settings screen and :feature:messages's feed switcher consume it. Then delete
ViewingPreferenceStore and fold SettingsRepository onto the shared owner.

Best done once the Settings epic (#31) has finished landing, so it is not fighting five parallel
branches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Completeness / settings surface

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions