Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: display status of sending request steps - INS-3635 #7382

Merged
merged 26 commits into from
Jun 18, 2024

Conversation

ihexxa
Copy link
Contributor

@ihexxa ihexxa commented May 7, 2024

Changes

  • Enabled http request timing observing
  • Enabled GQL timing observing
  • Enabled mock route test timing observing
  • Added after-response script step

Ref: INS-3821, INS-3635

Screenshot 2024-05-21 at 16 38 29

@ihexxa ihexxa self-assigned this May 7, 2024
@ihexxa ihexxa marked this pull request as draft May 7, 2024 07:10
@ihexxa ihexxa changed the title feat: display status of sending request steps feat: display status of sending request steps - INS-3635 May 7, 2024
@ihexxa ihexxa marked this pull request as ready for review May 15, 2024 07:05
@ihexxa ihexxa requested a review from a team May 15, 2024 07:06
@ihexxa ihexxa marked this pull request as draft May 15, 2024 07:06
@ihexxa ihexxa marked this pull request as ready for review May 29, 2024 03:34
Copy link
Contributor

@jackkav jackkav left a comment

Choose a reason for hiding this comment

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

feedback

  • language is a bit unclear, visually we are looking at a single execution with many steps/phases
  • timingrecord is unclear name, rename record to step/phase
  • avoid try catch finally for control flow, replace with a clear begin and end process events
  • post request script takes double the time taken that it should when i add a setTimeout
  • endedAt is not a safe type to be setting to the number 0 because it is used as a date, better would be to make null or a duration rather than a timestamp
  • isDone is duplicate data, since we can infer that if endedAt exists then it must be true.
  • total time taken breakdown in hover?
image

@jackkav
Copy link
Contributor

jackkav commented Jun 7, 2024

Still todo

fix bug where navigating away from a running request loses the loading state. below steps related:

  • eliminate the runningRequests variable, replace with execution map
  • extract the watcher as a hook
  • consider object rather than array from executions, because of indirection (last)

@jackkav
Copy link
Contributor

jackkav commented Jun 13, 2024

Couple changes left

  • perhaps use an alternative ui method of overlaying instead of errorboundary
  • fix logic in response pane so it overlays over last request

Comment on lines 15 to 16
// only one observer is allowed for simplicity
const executionObservers = new Map<string, TimingCallback>();
Copy link
Contributor

Choose a reason for hiding this comment

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

current problem is we use this in three places so they overwrite each other and only one works. I've looked at making it an array but then we have a a few new problems. Wondering if theres a better way, I've looked at file watching the timeline and that has a couple new problems too. I'm sure theres a simpler way I'm just not seeing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's see if there is a simple solution or I might propose to move forward with the main requirement firstly then move to changes after e592cab.

Copy link
Contributor

@jackkav jackkav Jun 17, 2024

Choose a reason for hiding this comment

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

We moved it to main, in order to benefit from the ipc event emitter pattern. This way its consistent across all usages of the hook at open windows/instances.

Whats left is some tidying up of names to make it consistent, and some testing.

The big benefit of this approach is we can easily change the persistence layer later to use another state store like the timeline instead of the executions map.

Thanks @gatzjames for the ideas and support.

jackkav
jackkav previously approved these changes Jun 18, 2024
@jackkav jackkav merged commit b8089ce into develop Jun 18, 2024
7 checks passed
@jackkav jackkav deleted the feat-send-progress branch June 18, 2024 06:58
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.

None yet

3 participants