Skip to content

Bug: GoalTracker goals are stored only in localStorage and don't sync across devices #8276

Description

@kanishka-2007-tech

Description

The GoalTracker component currently stores users' monthly and yearly contribution goals exclusively in localStorage using the useLocalStorage hook. As a result, goals are tied to a single browser and are lost when users switch devices, clear browser data, or use private/incognito mode.

Since users are already identified by their GitHub username and the project already uses MongoDB with a User model, contribution goals should be persisted server-side and synchronized across devices.

Steps to Reproduce

Open the dashboard.
Set custom monthly/yearly goals.
Refresh the page (works correctly).
Open the dashboard in another browser/device or
clear browser storage.
Observe that goals revert to the default values.

Expected Behavior

Store goal preferences in the backend (MongoDB).
Associate goals with the authenticated GitHub user.
Automatically load saved goals whenever the dashboard is opened.
Keep localStorage only as an optional cache/fallback if desired.
Ensure users have a consistent experience across all devices.

Screenshots / Logs

No response

GitHub Username (If applicable)

kanishka-2007-tech

Environment

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions