question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enforce Order of Recordings

See original GitHub issue

Context

We use nockBack and would like to enforce the order of our recording files. Ideally there is a timeout option that can be set to allow for parallel recordings.

Example: One request is made, then two other requests are made in parallel. Assuming a correct recording file already exists, the first request should match the first recorded request. However the second request might match the second or third recording. Ideally, if the request does not match the next recording, the request (nock) should wait for that recording to be consumed by any parallel requests.

Alternatives

Currently there doesn’t seem to be any way to enforce this satisfactorily, let alone the parallel consideration mentioned above.

Has the feature been requested before?

Didn’t find an anything surprisingly?

If the feature request is accepted, would you be willing to submit a PR?

Sure. As usually the biggest problem in this code base is figuring out where to make the change, so I’ll need help with that 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:48 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
mastermattcommented, Jul 15, 2019

@simlu I’m curious if you’ve looked into implementing a test for your use case using the request or replied events emitted on Scopes. https://github.com/nock/nock#events

1reaction
simlucommented, Mar 12, 2019

@paulmelnikow I think it is necessary to delay since otherwise you can not handle parallel requests. And those are very essential for performance for us. Immediate nock failure would just result in random failures for those tests…

Unless… the nock interception prevents any true async handling and hence the order would always be consistent? In that case it might be fine? But even then the recording order might not be the same as the later execution order (or does nock record in order of request start, not end?).

I realize that I don’t know enough about the internals of this library to answer that question 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

132-1.4A. Law enforcement agency recordings.
The court may order the disclosure of the recording only if the court finds that the law enforcement agency abused its discretion in...
Read more >
How do you enforce record order in a form? - MSDN - Microsoft
1. Create a query with the correct sorting order · 2. Open the query to make sure it is correctly showing the records...
Read more >
RECORDING CONVERSATIONS IN ALL 50 STATES CHART ...
Common exceptions found in a majority of states' laws include recordings captured by police, court order, communication service providers, emergency services, ...
Read more >
Know Your Rights When Taking Photos and Making Video ...
Unfortunately, law enforcement officers often order people to stop taking photographs or video in public places, and sometimes harass, detain or even arrest ......
Read more >
AOC-CV-274 - The North Carolina Judicial Branch
Order To Provide Custodial Law Enforcement Agency Recording For In-Camera Review And Order To Provide Notice Of Hearing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found