Skip to content

Sync user data once and patch on successive changes - #176

Open
simonwep wants to merge 3 commits into
mainfrom
data-patches
Open

simonwep wants to merge 3 commits into
mainfrom
data-patches

Conversation

@simonwep

@simonwep simonwep commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

With this PR the entire data-stack is pushed once to the server and json patches are used afterwards. It's much faster and efficient than updating the whole value for each key every time.

I made sure that:

  • I have read the contributing guidelines.
  • I have searched for a similar pull request.
  • The feature/bug-fix is tested carefully.
  • All irrelevant commits are squashed. (e.g. no chore: fix eslint commits).
  • The branch is up to date with the base branch.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical flaws can overwrite another account’s data, lose or duplicate changes during synchronization, and exhaust server memory through unbounded patch-copy expansion.

6 open issues
1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

This PR moves user-data synchronization from repeated full-state uploads to an initial upload followed by JSON patches, updating both the Vue stores and the Genesis backend.

Changes:

  • Route budget, year, and settings mutations through a shared patch queue.
  • Add a Genesis PATCH endpoint, SDK support, dependencies, and backend tests.
  • Adjust login feedback, logger formatting, and commit-message validation.
File Description
src/​utils/​logger/​logger.ts Add logger-specific colors and level labels.
src/​store/​storage/​useStorage.ts Manage initial uploads, queued patches, and retries.
src/​store/​state/​index.ts Route state updates and imports through patches.
src/​store/​state/​actions/​year.actions.ts Convert year actions and undo operations to patches.
src/​store/​state/​actions/​budgetGroup.actions.ts Convert budget-group actions to patches.
src/​store/​state/​actions/​budget.actions.ts Convert budget actions and undo operations to patches.
src/​store/​state/​actions/​action.types.ts Define readonly state and mutation interfaces.
src/​store/​state/​actions/​action.helpers.ts Add path lookup and move-operation helpers.
src/​store/​settings/​index.ts Route settings changes through patches.
src/​store/​genesis/​genesis.sdk.ts Add JSON Patch types and client requests.
src/​app/​pages/​navigation/​auth/​LoginDialog.vue Hide the session warning during login requests.
pnpm-lock.yaml Lock the frontend patch dependency.
package.json Add rfc6902.
genesis/​routes/​setup.go Register the PATCH endpoint.
genesis/​routes/​data.go Apply patches and share request validation.
genesis/​routes/​data_test.go Test patch operations, validation, and size limits.
genesis/​go.sum Record backend patch dependency checksums.
genesis/​go.mod Add the Go JSON Patch library.
.husky/​commit-msg Revise accepted commit types and add optional scopes.

Review effort: Balanced

Comment thread genesis/routes/data.go Resolved
Comment thread genesis/routes/data.go Resolved
Comment thread src/store/storage/useStorage.ts Resolved
Comment thread src/store/storage/useStorage.ts Resolved
Comment thread src/store/storage/useStorage.ts Resolved
Comment thread src/store/storage/useStorage.ts Resolved

This branch has not been deployed

No deployments
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