-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add user metadata to Yorkie Client initialization #452
Conversation
WalkthroughThis pull request removes the pre-commit hook script (which handled linting for both frontend and backend) and updates the Yorkie dependency in the frontend. Additionally, the Changes
Sequence Diagram(s)sequenceDiagram
participant C as Component
participant H as useYorkieDocument Hook
participant S as Redux Store
participant Y as Yorkie Client
C->>H: Invoke useYorkieDocument
H->>S: Retrieve user data (selectUser)
S-->>H: Return userID (if available)
H->>Y: Create Yorkie Client with { metadata: { userID } }
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/src/hooks/useYorkieDocument.ts (1)
54-64
: Consider improving type safety and null handling.The client initialization with user metadata is well-implemented, but could benefit from some minor improvements:
Consider these enhancements:
- const userID = userStore.data?.id || ""; + const userID = userStore.data?.id ?? null; - if (userID) { + if (userID !== null) { opts.metadata = { userID }; }This makes the null handling more explicit and maintains better type safety.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
.husky/pre-commit
(0 hunks)frontend/package.json
(1 hunks)frontend/src/hooks/useYorkieDocument.ts
(3 hunks)
💤 Files with no reviewable changes (1)
- .husky/pre-commit
✅ Files skipped from review due to trivial changes (1)
- frontend/package.json
🔇 Additional comments (2)
frontend/src/hooks/useYorkieDocument.ts (2)
11-11
: LGTM!The import of
selectUser
is correctly added and follows the existing import pattern.
24-24
: LGTM!The
userStore
selector is correctly implemented, following the same pattern as the existingauthStore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution.
What this PR does / why we need it:
Add user metadata to Yorkie Client initialization
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
Chores