Skip to content

Conversation

abnegate
Copy link
Member

@abnegate abnegate commented Sep 23, 2025

This PR contains updates to the React Native SDK for version 0.13.0.

Summary by CodeRabbit

  • New Features

    • Added random ordering option for queries.
  • Refactor

    • Equality and inequality query helpers now accept a single value (not arrays), which may require updates in existing usage.
  • Documentation

    • Corrected description of request headers in model docs.
  • Chores

    • Bumped SDK version to 0.14.0.

Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

The release updates package.json version to 0.14.0 and aligns the x-sdk-version header in src/client.ts to 0.14.0. In src/models.ts, the JSDoc for Execution.requestHeaders now correctly refers to HTTP request headers; types remain unchanged. In src/query.ts, the signatures of Query.equal and Query.notEqual changed from (attribute: string, value: QueryTypes | any[]) to (attribute: string, value: QueryTypes). A new static method, Query.orderRandom(), was added, returning a query string with method "orderRandom".

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title "feat: React Native SDK update for version 0.13.0" correctly signals an SDK update but is misleading: the diff shows the package and client headers bumped from 0.13.0 to 0.14.0 and additional changes in src/query.ts and src/models.ts, so the version in the title does not match the changeset. This mismatch could confuse reviewers and git history. Update the PR title to accurately reflect the changes (for example "feat: React Native SDK update to v0.14.0") and align the PR description with that version, or if the bump was accidental revert the version changes so the title matches the code.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/client.ts (1)

118-118: x-sdk-version updated to 0.14.0 — good. Consider de-duping version sources.

To avoid future drift between package.json and this header, consider injecting the version at build time (e.g., Rollup define/replace) instead of hardcoding.

Example Rollup replace (conceptual):

+// rollup.config.js
+import replace from '@rollup/plugin-replace';
 export default {
   plugins: [
+    replace({
+      preventAssignment: true,
+      __SDK_VERSION__: JSON.stringify(require('./package.json').version),
+    }),
   ]
 }
- 'x-sdk-version': '0.14.0',
+ 'x-sdk-version': __SDK_VERSION__,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fd45f5 and 6af2412.

📒 Files selected for processing (4)
  • package.json (1 hunks)
  • src/client.ts (1 hunks)
  • src/models.ts (1 hunks)
  • src/query.ts (2 hunks)
🔇 Additional comments (3)
src/query.ts (2)

36-41: equal/notEqual typing change — looks safe.

Switch to QueryTypes retains array support via QueryTypesList, so no breaking change expected.

Please confirm existing call sites using array values still type-check and behave as before (e.g., Query.equal('status', ['open','closed'])).


81-83: New Query.orderRandom(): LGTM.

Nice addition. Add usage to README/API docs and clarify interaction with orderAsc/Desc (mutual exclusivity or last-one-wins).

package.json (1)

5-5: Version bump to 0.14.0 — LGTM; verify external release metadata.

rg found package.json:5 and src/client.ts:118 set to 0.14.0; no 0.13.0 in the repo. Confirm PR title, release tag, and CHANGELOG on GitHub are updated to 0.14.0.

Comment on lines +1025 to 1027
* HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
*/
requestHeaders: Headers[];
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick

Doc wording mismatch with type (array vs key-value object).

requestHeaders is Headers[], not a key-value object. Update the JSDoc to reflect an array of {name, value} pairs. Similarly adjust responseHeaders (Line 1037) for consistency.

Apply:

- * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
+ * List of HTTP request headers as name/value pairs. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.

And for response headers (near Line 1037):

- * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
+ * List of HTTP response headers as name/value pairs. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
*/
requestHeaders: Headers[];
* List of HTTP request headers as name/value pairs. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
*/
requestHeaders: Headers[];
🤖 Prompt for AI Agents
In src/models.ts around lines 1025-1027 (and similarly near line 1037 for
responseHeaders), the JSDoc incorrectly describes requestHeaders/responseHeaders
as a key-value object while the actual type is Headers[]; update the JSDoc
comments to state that these fields are arrays of header objects (e.g., an array
of { name: string, value: string } pairs), mention that only whitelisted headers
are included unless execution is synchronous, and ensure the wording matches the
Headers[] type for consistency.

@abnegate abnegate merged commit fc3b511 into main Sep 23, 2025
1 check passed
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