Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

@vdavid
Copy link
Contributor

@vdavid vdavid commented Feb 17, 2023

I've found that on dotcom, there are so many outbound requests per minute that it's practically impossible to investigate the requests because of the 5-sec polling. Annoying vid that demoes this in 25 seconds

In this PR, I add this button to the top-right to pause/resume polling:

CleanShot 2023-02-17 at 16 42 28@2x

I just copy-pasted the existing solution on the "background jobs" page. Didn't bother this time to extract the functionality to a component because it's not that long, it's only two copies for now, and I think it could be a good improvement for this page before the branch cut. Would consider extracting this code to a component/hook at its third use.

Test plan

Tested it locally, it nicely pauses and resumes polling: 20-sec Loom

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot bot added the cla-signed label Feb 17, 2023
@vdavid vdavid requested a review from mrnugget February 17, 2023 15:51
@github-actions
Copy link
Contributor

Problem: the label i-acknowledge-this-goes-into-the-release is absent.
👉 What to do: we're in the next Sourcegraph release code freeze period. If you are 100% sure your changes should get released or provide no risk to the release, add the label your PR with i-acknowledge-this-goes-into-the-release.
When does the freeze end? The code freeze is active until 2023-02-22 at 23:59 UTC.

@vdavid vdavid requested review from a team and pjlast February 17, 2023 15:54
@sg-e2e-regression-test-bob
Copy link

sg-e2e-regression-test-bob commented Feb 17, 2023

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.00% (+0.20 kb) 0.00% (+0.20 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 90348da and 6b357b3 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

Copy link
Contributor

@mrnugget mrnugget left a comment

Choose a reason for hiding this comment

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

Very nice!

@vdavid
Copy link
Contributor Author

vdavid commented Feb 17, 2023

Marked @pjlast because I have a vague memory that you wanted to add this earlier. (Sorry if I remembered wrong.)

<div className="site-admin-outbound-requests-page">
<PageTitle title="Outbound requests - Admin" />
<Button variant="secondary" onClick={togglePolling} className="float-right">
{polling ? 'Pause polling' : 'Resume polling'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is polling a good name to show for the admins? Maybe "Pause updates"?

Copy link
Contributor Author

@vdavid vdavid Feb 17, 2023

Choose a reason for hiding this comment

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

👍 Modified it to "Pause/Resume updating"

</Button>
<PageHeader
path={[{ text: 'Outbound requests' }]}
headingElement="h2"
Copy link
Contributor

Choose a reason for hiding this comment

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

The text below mentions "The list updates every five seconds." - Should we update this as well when the updates are paused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I'm removing that when you stop polling. It's totally fancy now. ✨

@vdavid vdavid merged commit dab4fb4 into main Feb 17, 2023
@vdavid vdavid deleted the dv/outbound-request-pause-polling branch February 17, 2023 18:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants