-
Notifications
You must be signed in to change notification settings - Fork 1
some changes #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some changes #526
Conversation
…account start work on settings sync
|
Caution Review failedThe pull request is closed. WalkthroughRemoves Arch Linux container and pacman installs from CI, switching to pnpm/action-setup. Backend adds JWT verification/utilities, a users table, and sync endpoints; updates backups to use user ids. Frontend adds sync helpers/state, adjusts UI components, themes Clerk, and adds an /account page rendering UserProfile. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Frontend UI
participant Sync as sync.save (client)
participant API as Convex api.sync.update
participant Utils as utils (verifyJwt,getUser,getAndUpdateUser)
participant DB as DB (users)
UI->>Sync: save(jwt, client, {settings|history|favourites})
Sync->>API: update({ jwt, settings?, history?, favourites? })
API->>Utils: verifyJwtAndGetPayload(jwt)
Utils-->>API: payload (sub)
API->>Utils: getAndUpdateUser(ctx, payload)
Utils->>DB: find/patch/insert by clerkId
DB-->>Utils: user (_id)
Utils-->>API: userInfo (_id)
API->>DB: patch users[_id] with provided fields
DB-->>API: ok
API-->>Sync: ok
Sync-->>UI: clear syncState
note over API,DB: Errors if jwt invalid or user missing
sequenceDiagram
autonumber
participant Client as Frontend
participant BGet as convex.backups.get
participant BCreate as convex.backups.create
participant BRemove as convex.backups.remove
participant Utils as utils (verifyJwt, getUser/getAndUpdateUser)
participant DB as DB (backups, users)
rect rgb(235,245,255)
note right of Client: Get backups
Client->>BGet: { jwt }
BGet->>Utils: verifyJwtAndGetPayload
BGet->>Utils: getUser(ctx, payload)
Utils-->>BGet: userInfo or null
alt user not found
BGet-->>Client: []
else user found
BGet->>DB: query backups by userId
DB-->>BGet: list (name,data,creationTime,id)
BGet-->>Client: results
end
end
rect rgb(245,235,255)
note right of Client: Create backup
Client->>BCreate: { jwt, name, data }
BCreate->>Utils: verifyJwtAndGetPayload
BCreate->>Utils: getAndUpdateUser
Utils-->>BCreate: userInfo (_id)
BCreate->>DB: insert { user: _id, name, data }
DB-->>BCreate: ok
BCreate-->>Client: ok
end
rect rgb(235,255,245)
note right of Client: Remove backup
Client->>BRemove: { jwt, id }
BRemove->>Utils: verifyJwtAndGetPayload
BRemove->>DB: get backup[id]
DB-->>BRemove: backup
BRemove->>Utils: getAndUpdateUser
Utils-->>BRemove: userInfo (_id)
alt authorized (backup.user == _id)
BRemove->>DB: delete id
DB-->>BRemove: ok
BRemove-->>Client: ok
else unauthorized
BRemove-->>Client: Unauthorized
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying edutools-testing with
|
| Latest commit: |
545b726
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6ab843a4.edutools-testing.pages.dev |
| Branch Preview URL: | https://main.edutools-testing.pages.dev |
Summary by CodeRabbit
New Features
Style
Chores