-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[FEATURE] Return Record key as well as data in Data Stores: Get Record action #15905
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis pull request updates the version numbers and enhances export handling in two data store action modules. In the delete action, it adds export statements for the key variable in all cases. In the get-or-create action, the control flow is refactored to use local variables for summary and response, streamlining the logic. Additionally, the package version is bumped in the package.json file. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant deleteAction as DeleteSingleRecord.run
participant DS as DataStore
Client->>deleteAction: Invoke run(key)
deleteAction->>DS: Retrieve record by key
alt Record Found
DS-->>deleteAction: Record data
deleteAction->>DS: Delete record
deleteAction->>Client: Export key & deletion summary
else Record Not Found
DS-->>deleteAction: Null
deleteAction->>Client: Export key & not found summary
end
sequenceDiagram
participant Client
participant createAction as GetRecordOrCreate.run
participant DS as DataStore
Client->>createAction: Invoke run(key)
createAction->>DS: Retrieve record by key
alt Record Found
DS-->>createAction: Existing record
createAction->>Client: Export summary, key, record
else Record Not Found
DS-->>createAction: Null
createAction->>Client: Evaluate addRecordIfNotFound
alt Do Not Add
createAction->>Client: Export summary & key without record
else Add Record
createAction->>DS: Parse value & add record (check TTL)
DS-->>createAction: New record created
createAction->>Client: Export summary, key, and new record
end
end
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
Scope: all 2 workspace projects Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (6)
✨ Finishing Touches
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. 🪧 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.
LGTM!
| if (this.ttl) { | ||
| return { | ||
| value: parsedValue, | ||
| ttl: this.ttl, | ||
| }; | ||
| } |
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.
This looks like it returns too early, and therefore doesn't export the summary or key.
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.
@binarymonkey84 Thanks for catching that. I created an update to fix it here: #15913
Resolves #15858
key.Summary by CodeRabbit
Refactor
Chores