Skip to content

fix: timeline url race condition#7154

Open
pooja-bruno wants to merge 1 commit intousebruno:mainfrom
pooja-bruno:fix/timeline-stale-url-race-condition
Open

fix: timeline url race condition#7154
pooja-bruno wants to merge 1 commit intousebruno:mainfrom
pooja-bruno:fix/timeline-stale-url-race-condition

Conversation

@pooja-bruno
Copy link
Collaborator

@pooja-bruno pooja-bruno commented Feb 16, 2026

Description

JIRA

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced timeline to accurately track and display URL changes across successive requests.
    • Improved request tracking with better visibility into request execution status.
  • Tests

    • Added end-to-end test coverage for timeline functionality with URL updates.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Walkthrough

The changes add a requestSent field throughout the request-response pipeline to expose whether a network request was actually sent. This field is threaded from the network layer through IPC, Redux actions, and the reducer to enable downstream consumption. An E2E test is added to validate timeline updates when request URLs change across successive requests.

Changes

Cohort / File(s) Summary
Network & IPC Layer
packages/bruno-app/src/utils/network/index.js, packages/bruno-electron/src/ipc/network/index.js
Add requestSent field to response objects returned by network request handlers in both the app and Electron IPC layers.
Redux Pipeline
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js, packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
Extract and thread requestSent through Redux action dispatch, and introduce timeline request resolution logic with fallback chain (action.payload.requestSentitem.requestSentitem.request).
E2E Test
tests/request/timeline/timeline-url-update.spec.ts
Add Playwright test validating Timeline tab correctly displays multiple entries with URL changes across successive requests, including response pane tab navigation helper.

Sequence Diagram

sequenceDiagram
    participant UI as UI Layer
    participant Network as Network Layer
    participant IPC as Electron IPC
    participant Redux as Redux Store
    participant Timeline as Timeline State

    UI->>Network: sendNetworkRequest()
    Network->>Network: Execute HTTP request
    Network-->>IPC: Response + requestSent flag
    IPC->>IPC: Attach requestSent to payload
    IPC-->>Redux: IPC response with requestSent
    Redux->>Redux: sendRequest (actions.js)
    Redux->>Redux: Extract requestSent, serialize responseData
    Redux->>Redux: dispatch(responseReceived)
    Redux->>Timeline: responseReceived reducer
    Timeline->>Timeline: Resolve timelineRequest (requestSent > requestSent > request)
    Timeline->>Timeline: Create timeline entry with resolved request
    Timeline-->>UI: Update timeline state
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~23 minutes

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • sid-bruno

Poem

🔗 Through layers we thread the requestSent flow,
From network to Redux, the data will go,
Timeline entries track each URL's dance,
A request's journey—now visible at glance! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (9 files):

⚔️ packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (content)
⚔️ packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js (content)
⚔️ packages/bruno-app/src/utils/codemirror/autocomplete.js (content)
⚔️ packages/bruno-app/src/utils/codemirror/autocomplete.spec.js (content)
⚔️ packages/bruno-app/src/utils/network/index.js (content)
⚔️ packages/bruno-converters/tests/bruno/bruno-to-postman-translations/request.test.js (content)
⚔️ packages/bruno-electron/src/ipc/network/index.js (content)
⚔️ packages/bruno-js/src/bruno-request.js (content)
⚔️ packages/bruno-js/src/sandbox/quickjs/shims/bruno-request.js (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: timeline url race condition' directly addresses the main change: handling a race condition in timeline URL display across multiple requests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch fix/timeline-stale-url-race-condition
  • Post resolved changes as copyable diffs in a comment

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.

❤️ 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.

🧹 Nitpick comments (1)
tests/request/timeline/timeline-url-update.spec.ts (1)

54-60: Prefer a locator-based wait over page.waitForTimeout(200).

Per the e2e coding guidelines, waitForTimeout should be avoided when a proper Playwright assertion or locator wait can replace it. After typing the new URL, you could wait for the CodeMirror content to reflect the new value:

Suggested approach
      await page.keyboard.type(secondUrl);
-     await page.waitForTimeout(200);
+     // Wait for CodeMirror to reflect the new URL
+     await expect(urlEditor).toContainText('headers', { timeout: 2000 });
      await sendRequest(page, 200);

This makes the test deterministic regardless of machine speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments