X Tutup
Skip to content

Fixed issue with null params sent with =#4440

Merged
rohitneharabrowserstack merged 4 commits intomasterfrom
ONCALL-307_null_params_fix
Mar 6, 2026
Merged

Fixed issue with null params sent with =#4440
rohitneharabrowserstack merged 4 commits intomasterfrom
ONCALL-307_null_params_fix

Conversation

@rohitneharabrowserstack
Copy link
Contributor

@rohitneharabrowserstack rohitneharabrowserstack commented Feb 27, 2026

Closes issue:

📜 Summary of changes:

🎥 Demo Video:

Video/Demo:

✅ Checklist:

  • Make sure linting and unit tests pass.
  • No install/build warnings introduced.
  • Verified UI in browser.
  • For UI changes, added/updated analytics events (if applicable).
  • For changes in extension's code, manually tested in Chrome and Firefox.
  • Added/updated unit tests for this change.
  • Raised pull request to update corresponding documentation (if already exists).
  • Added demo video showing the changes in action (if applicable).

🧪 Test instructions:

🔗 Other references:

Summary by CodeRabbit

  • Bug Fixes

    • Query parameters are now consistently serialized into request URLs and removed from the request payload for reliable request formatting.
  • New Features

    • Optional URL encoding for query parameters (disabled by default).
    • Null/empty values are treated as key-only parameters and multiple parameters are joined correctly.

@linear
Copy link

linear bot commented Feb 27, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 19e6f54b-e41b-4382-a5ce-9799a9c118be

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4adfe and 76a315d.

📒 Files selected for processing (1)
  • app/src/features/apiClient/helpers/httpRequestExecutor/httpRequestExecutor.ts

Walkthrough

The diff changes query-parameter handling for HTTP requests. app/src/features/apiClient/helpers/httpRequestExecutor/httpRequestExecutor.ts now clones the request into a preparedEntryRequest, serializes its queryParams into the request URL via queryParamsToURLString (with encoding enabled) and clears the queryParams before calling makeRequest. app/src/features/apiClient/screens/apiClient/utils.ts updates queryParamsToURLString to accept an optional shouldEncode boolean (default false), treats null like no-value parameters, and encodes keys and values when shouldEncode is true.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • iostreamer-X
  • nafees87n
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template structure with no substantive content filled in; all required sections are empty and checklist items are unchecked. Fill in the 'Summary of changes', link the related issue, provide demo/video or explanation why not applicable, and complete the test instructions and checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fixed issue with null params sent with =' clearly describes the main change in the PR—fixing how null parameters are handled when serialized to URL strings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ONCALL-307_null_params_fix

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
Contributor

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/features/apiClient/screens/apiClient/utils.ts (1)

618-635: ⚠️ Potential issue | 🟠 Major

Preserve existing URL query when queryParams is empty.

This helper currently drops any query already present in inputString because it always rebuilds from queryParams. With the new executor usage, that can silently remove user-specified URL params.

Proposed fix
 export const queryParamsToURLString = (queryParams: KeyValuePair[], inputString: string, shouldEncode = false) => {
+  if (queryParams.length === 0) {
+    return inputString;
+  }
   const baseUrl = split(inputString, "?")[0];
   const enabledParams = queryParams.filter((param) => param.isEnabled ?? true);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/features/apiClient/screens/apiClient/utils.ts` around lines 618 -
635, The helper queryParamsToURLString currently rebuilds the URL and drops any
existing query when no params are provided; to fix this, in
queryParamsToURLString (use symbols baseUrl, inputString, enabledParams) check
if enabledParams.length === 0 (or there are no truthy keys to add) and if so
simply return inputString as-is to preserve its existing query string; otherwise
proceed with the current mapping/encoding logic to build and return
`${baseUrl}?${queryString}` when queryString exists.
🧹 Nitpick comments (1)
app/src/features/apiClient/helpers/httpRequestExecutor/httpRequestExecutor.ts (1)

291-308: Log the same request object that is actually executed.

After introducing preparedEntryRequest, telemetry can diverge from real network behavior because logging still uses preparedEntry.request. For debugging/replay fidelity, log preparedEntryRequest.

Proposed refactor
-    APIEventLogger.logRequest({
-      request: preparedEntry.request,
-      workspaceId: this.ctx.workspaceId,
-      tag: {
-        recordId,
-        iteration: iterationContext.iteration,
-        executionId: execId,
-      },
-    });
-
     const preparedEntryRequest = {
       ...preparedEntry.request,
       url: queryParamsToURLString(preparedEntry.request.queryParams, preparedEntry.request.url, true),
       queryParams: [],
     };
+    APIEventLogger.logRequest({
+      request: preparedEntryRequest,
+      workspaceId: this.ctx.workspaceId,
+      tag: {
+        recordId,
+        iteration: iterationContext.iteration,
+        executionId: execId,
+      },
+    });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/features/apiClient/helpers/httpRequestExecutor/httpRequestExecutor.ts`
around lines 291 - 308, The telemetry currently logs preparedEntry.request but
the code actually executes preparedEntryRequest; compute/build
preparedEntryRequest (the object with url from queryParamsToURLString and
queryParams: []) before calling APIEventLogger.logRequest and pass
preparedEntryRequest to APIEventLogger.logRequest instead of
preparedEntry.request so the logged request matches what is passed to
makeRequest (refer to preparedEntryRequest, preparedEntry.request,
APIEventLogger.logRequest, and makeRequest).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@app/src/features/apiClient/screens/apiClient/utils.ts`:
- Around line 618-635: The helper queryParamsToURLString currently rebuilds the
URL and drops any existing query when no params are provided; to fix this, in
queryParamsToURLString (use symbols baseUrl, inputString, enabledParams) check
if enabledParams.length === 0 (or there are no truthy keys to add) and if so
simply return inputString as-is to preserve its existing query string; otherwise
proceed with the current mapping/encoding logic to build and return
`${baseUrl}?${queryString}` when queryString exists.

---

Nitpick comments:
In
`@app/src/features/apiClient/helpers/httpRequestExecutor/httpRequestExecutor.ts`:
- Around line 291-308: The telemetry currently logs preparedEntry.request but
the code actually executes preparedEntryRequest; compute/build
preparedEntryRequest (the object with url from queryParamsToURLString and
queryParams: []) before calling APIEventLogger.logRequest and pass
preparedEntryRequest to APIEventLogger.logRequest instead of
preparedEntry.request so the logged request matches what is passed to
makeRequest (refer to preparedEntryRequest, preparedEntry.request,
APIEventLogger.logRequest, and makeRequest).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d11b50f and f6a7a55.

📒 Files selected for processing (2)
  • app/src/features/apiClient/helpers/httpRequestExecutor/httpRequestExecutor.ts
  • app/src/features/apiClient/screens/apiClient/utils.ts

Copy link
Contributor

@nafees87n nafees87n left a comment

Choose a reason for hiding this comment

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

Looks good

@rohitneharabrowserstack rohitneharabrowserstack merged commit da1a851 into master Mar 6, 2026
1 of 2 checks passed
@rohitneharabrowserstack rohitneharabrowserstack deleted the ONCALL-307_null_params_fix branch March 6, 2026 05:34
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

X Tutup