Add back username handling#6
Add back username handling#6reynaldichernando wants to merge 2 commits intoJavaScript-Mastery-Pro:mainfrom
Conversation
|
@reynaldichernando is attempting to deploy a commit to the JS Mastery Pro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds USER_PREFIX and resolveUsername helper to fetch/cache usernames in KV. For public projects, list/get/save flows now resolve ownerId → username and attach it as sharedBy; save caches usernames; clear deletes USER_PREFIX entries and returns clearedUsernames. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client as Client
participant API as "API (/api/projects/*)"
participant Worker as "puter.worker.js"
participant KV as "KV Store"
rect rgba(200,200,255,0.5)
Client->>API: request /api/projects/list (public)
API->>Worker: forward request
Worker->>KV: fetch public items (ownerId list)
Worker->>KV: batch get USER_PREFIX+ownerId -> username(s)
KV-->>Worker: usernames (or miss)
Worker->>KV: on miss, fetch user info and KV.put(USER_PREFIX+id, username)
Worker-->>API: annotated items with sharedBy
end
API-->>Client: response with items (+ sharedBy, clearedUsernames when clearing)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
Summary by CodeRabbit
New Features
Chores