Closed Bug 1422014 Opened 7 years ago Closed 5 years ago

Resend option in netmonitor

Categories

(DevTools :: Netmonitor, enhancement, P3)

57 Branch
enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: interghost, Assigned: tanhengyeow, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(2 files)

In network monitor there is an option to "Edit and Resend" a request. I would be great to also have just a "Resend" option both in context menu and button in Headers subtab.

Also this would be great to have in Console tab context menu... there already is a Bug #879704 closed as won't fix for this.
In Firebug Resend option was present in Console tab... that was such a great time saver on debugging that I don't understand why is this a won't fix?

It may seem trivial but doing heavy debugging with, for example, 20 resends you now have to go through 80 clicks in various screen parts and tab switchings.. and it was just 20 clicks in Firebug.
The more you do it the more the diff and time waste gets to be a really big deal. 

Having atleast the "Resend" (without edit) option will eliminate 1 of the clicks in the flow.
I like the idea and I think the "Resend" action could be easily available in the context menu (in both network and console panel). The code base is now different and (from when Bug #879704 was closed) and it's simple to do this.

Honza
Mentor: odvarko
Keywords: good-first-bug
Priority: -- → P3
Hi Honza,
I am interested in working on this. Can I work on this?
Flags: needinfo?(odvarko)
Assigned!

Honza
Assignee: nobody → abhinav.koppula
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(odvarko)
Product: Firefox → DevTools
Assignee: abhinav.koppula → nobody
Status: ASSIGNED → NEW
:Honza 

Would love to be assigned this issue! :)
Flags: needinfo?(odvarko)
@Heng: I just assigned you to bug 1358038, so let's fix that one first :)

Honza
Flags: needinfo?(odvarko)
Hello, Honza,

I would like to try to work on this issue as my first contribution.
How I should proceed?

Thanks, Milena.
@Harald, any opinions on this?

To summarize:
1) The Net panel context menu should have one more action: "Resend" - resend clicked request immediately, no edit form.
2) The Console panel context menu should have this new "Resend" item too (only when clicking on a request).

Comments (no strong opinion):
- We don't need "Edit and Resend" in the Console. 
- We don't need additional button "Resend" in the Headers panel.

Honza
Flags: needinfo?(hkirschner)
Hello @Honza,

Please let me know if this issue is still available (I know it's been assigned before, but there haven't been any updates recently).

These are the steps I've taken so far:
1. I have firefox running locally (Nighty)
2. I've played with "edit and resend" and am aware of the two locations that the "resend" option has to be added (and I understand how this is timesaving).
3. I've looked into the code, and I reckon the solution is somewhere in devtools/client/netmonitor/src/ (selectors?)
4. No idea yet about Mercurial, but I'm familiar with Git, Javascript, CSS, and ReactJS, so hopefully I can figure this out!

I've never contributed to Mozilla before, so I also need to figure out that process still. 

Kind regards, 
Eva

p.s. I'm also on slack (@eva)
SGTM.

I do like the idea of a quick Resend option, especially for RESTful API development.
Flags: needinfo?(hkirschner)
(In reply to Milena Boselli from comment #6)
> I would like to try to work on this issue as my first contribution.
> How I should proceed?
Assigned to you.

0) Read about how to contribute to Firefox Developer Tools
https://developer.mozilla.org/en-US/docs/Tools/Contributing

1) The edit and resend panel (aka CustomRequestPanel component) is implemented here:
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/src/components/CustomRequestPanel.js

2) The context menu with 'edit and resend' action is here:
https://searchfox.org/mozilla-central/rev/a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/widgets/RequestListContextMenu.js#179

3) Here is the action object that clones the selected request and opens the form:
https://searchfox.org/mozilla-central/rev/a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/actions/requests.js#40

It's handled here (in a reducer):
https://searchfox.org/mozilla-central/rev/a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/reducers/requests.js#121

4) Here is the place where the code decides whether to display the edit and resend form or not:
https://searchfox.org/mozilla-central/rev/a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/components/NetworkDetailsPanel.js#43
- the `request` is the selected request.

See, again the reducer, that's where the `isCustom` prop is set:
https://searchfox.org/mozilla-central/rev/a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/reducers/requests.js#141


Note that knowledge about React & Redux is advantage here.

Let's start with the Network panel context menu and as soon as it works we can start with the Console menu.

Also, please ping Eva if you'd changed your mind and wanted to be unassigned from this bug, thanks!


(In reply to Eva from comment #8)
> Please let me know if this issue is still available (I know it's been
> assigned before, but there haven't been any updates recently).
Sorry, Milena asked first in this bug.

You might look here for alternatives: https://mzl.la/2zCcSFE

Honza
(In reply to Jan Honza Odvarko [:Honza] from comment #10)

Will do, thank you! :)
(In reply to Milena Boselli from comment #6)
> Hello, Honza,
> 
> I would like to try to work on this issue as my first contribution.
> How I should proceed?
> 
> Thanks, Milena.

Hi Milena, 

let me know if you would still like to work on this task, I'm quite familiar with React (not Redux though) and happy to take over if needed. 

Kind regards, 
Eva
(In reply to Jan Honza Odvarko [:Honza] from comment #10)
> (In reply to Milena Boselli from comment #6)
> > I would like to try to work on this issue as my first contribution.
> > How I should proceed?
> Assigned to you.
> 
> 0) Read about how to contribute to Firefox Developer Tools
> https://developer.mozilla.org/en-US/docs/Tools/Contributing
> 
> 1) The edit and resend panel (aka CustomRequestPanel component) is
> implemented here:
> https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/src/
> components/CustomRequestPanel.js
> 
> 2) The context menu with 'edit and resend' action is here:
> https://searchfox.org/mozilla-central/rev/
> a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/
> widgets/RequestListContextMenu.js#179
> 
> 3) Here is the action object that clones the selected request and opens the
> form:
> https://searchfox.org/mozilla-central/rev/
> a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/
> actions/requests.js#40
> 
> It's handled here (in a reducer):
> https://searchfox.org/mozilla-central/rev/
> a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/
> reducers/requests.js#121
> 
> 4) Here is the place where the code decides whether to display the edit and
> resend form or not:
> https://searchfox.org/mozilla-central/rev/
> a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/
> components/NetworkDetailsPanel.js#43
> - the `request` is the selected request.
> 
> See, again the reducer, that's where the `isCustom` prop is set:
> https://searchfox.org/mozilla-central/rev/
> a11c128b90ea85d7bb68f00c5de52c0794e0b215/devtools/client/netmonitor/src/
> reducers/requests.js#141
> 
> 
> Note that knowledge about React & Redux is advantage here.
> 
> Let's start with the Network panel context menu and as soon as it works we
> can start with the Console menu.
> 
> Also, please ping Eva if you'd changed your mind and wanted to be unassigned
> from this bug, thanks!
> 
> 
> (In reply to Eva from comment #8)
> > Please let me know if this issue is still available (I know it's been
> > assigned before, but there haven't been any updates recently).
> Sorry, Milena asked first in this bug.
> 
> You might look here for alternatives: https://mzl.la/2zCcSFE
> 
> Honza

(In reply to Eva from comment #12)
> (In reply to Milena Boselli from comment #6)
> > Hello, Honza,
> > 
> > I would like to try to work on this issue as my first contribution.
> > How I should proceed?
> > 
> > Thanks, Milena.
> 
> Hi Milena, 
> 
> let me know if you would still like to work on this task, I'm quite familiar
> with React (not Redux though) and happy to take over if needed. 
> 
> Kind regards, 
> Eva

Hello, @Honza and @Eva,

I'd like to give it a try.

Milena
Assignee: nobody → m.boselli
Status: NEW → ASSIGNED
Hello, @Honza

I've been working on it, but I'm having some difficulties.
I've managed to add the "Resend" option to the context menu and I understand that the click action of it should call the function sendCustomRequest(connector), but could not figure out how to do this.
Besides, in the reducer called by "Edit and resend", isCustom is set to true. What'd be the best way to use the same function without showing the CustomRequestPanel?
Another noob question: how can I debug the code?

Best regards,
Milena.
Flags: needinfo?(odvarko)
(In reply to Milena Boselli from comment #14)
> Hello, @Honza
> 
> I've been working on it, but I'm having some difficulties.
> I've managed to add the "Resend" option to the context menu and I understand
> that the click action of it should call the function
> sendCustomRequest(connector), but could not figure out how to do this.

Can you pleas attach your changes as a patch to this bug, so I can see how far you've got?

Honza
Flags: needinfo?(odvarko) → needinfo?(m.boselli)
Attached patch Bug1422014.patchSplinter Review
Flags: needinfo?(m.boselli)
Attachment #9020849 - Flags: feedback+

Hi Honza

Does the current patch need more work on it? Would be glad to tie up any loose ends if so :)

Flags: needinfo?(odvarko)

(In reply to Heng Yeow (:tanhengyeow) from comment #17)

Hi Honza

Does the current patch need more work on it? Would be glad to tie up any loose ends if so :)
I was just testing this and:

  1. The Network panel context menu has new "Resend" menu item, but it doesn't seem to work
  2. The Console panel doesn't have the menu at all

See comment #7 for summary of what should be done here.

Thanks!
Honza

Flags: needinfo?(odvarko)
Assignee: m.boselli → E0032242

Add resend option in the context menu of netmonitor.

Hi Honza

The attached patch does the following:

  1. When a context menu is clicked, the Resend option appears on top of the Edit and Resend option.
  2. When the Resend option is clicked, the same request is sent and appears at the bottom (signifies latest request). The request is also highlighted at the same time.

Would like to get your feedback on the patch :) Also, should I file a separate bug in the Console component for work to be done in the Console panel as well?

Flags: needinfo?(odvarko)

(In reply to Heng Yeow (:tanhengyeow) from comment #20)

Hi Honza

The attached patch does the following:

  1. When a context menu is clicked, the Resend option appears on top of the Edit and Resend option.
  2. When the Resend option is clicked, the same request is sent and appears at the bottom (signifies latest request). The request is also highlighted at the same time.

Would like to get your feedback on the patch :) Also, should I file a separate bug in the Console component for work to be done in the Console panel as well?

Thanks!

Feedback posted to Phabricator

Also, should I file a separate bug in the Console component for work to be done in the Console panel as well?

Yes, please

Honza

Flags: needinfo?(odvarko)

Hi Honza

Updated the patch shown in Phabricator and also filed the bug which can be seen in this Bug 1530138.

Flags: needinfo?(odvarko)

Thanks, I just commented on Phabricator.
Honza

Flags: needinfo?(odvarko)

Hi Honza

Updated the patch as seen in Phabricator.

Try results here for reference:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=4a4112eef6f95b3ea85ddde84396d0123c22d206

Flags: needinfo?(odvarko)
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bab6b17eee5
Resend option in netmonitor. r=Honza
Flags: needinfo?(odvarko)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68

I filled a follow up bug 1536828 for implementing "Resend" also in the Console panel.

Honza

Summary: Resend option in netmonitor / console → Resend option in netmonitor

Added this to the Network Request list context menu:

Resend
The Resend context menu option allows you to resend the request as it was originally sent with no changes made.

Flags: needinfo?(odvarko)

Sounds good to me, thanks Irene!
Honza

Flags: needinfo?(odvarko)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: