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.

Always makes unwanted http requests to API, instead of using existing recording

See original GitHub issue

When I rerun acceptance tests, my recordings are updated every time. It seems to me like the expiresIn option is not working. Am I missing anything obvious here w.r.t adding the config ?

I am using the "@pollyjs/ember" version 2.3.1 ember addon to use pollyjs in my ember app.

I have the following config entry in my ember-cli-build.js

pollyjs: {
      enabled: EmberApp.env() !== 'production',
      expiresIn: '30d5h10m',
      server: {
        expiresIn: '30d5h10m',
        keepUnusedRequests: false
      }
    }

Entry from package.json:

{
...
  "@pollyjs/ember": "^2.3.1",
...
}

Environment

Node.js v10.15.0
darwin 18.2.0
ember-cli: 3.7.0
node: 10.15.0
os: darwin x64

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
shankarsridharcommented, Mar 13, 2019

Thanks @offirgolan I played around with the config option to setupPollyand I was able to get it working like I wanted.

In case you are curious, this was the config that worked for me:

setupPolly(hooks, {
    mode: 'replay',
    expiresIn: '30days',
    matchRequestsBy: {
      headers: false,
      url: {
        pathname: false,
        query: false,
        hash: false
      }
    }
  });
0reactions
offirgolancommented, Mar 13, 2019

Np! Glad it worked out 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Securing APIs: 10 Best Practices for Keeping Your Data and ...
Validate input. Never pass input from an API through to the endpoint without validating it first. Use rate limiting. Setting a threshold above ......
Read more >
HTTP POST vs GET: Is One More Secure For Use In REST ...
This would be a reason to use GET for read-only API calls rather than POST. This section applies to traditional web applications and...
Read more >
Best practices for REST API design - Stack Overflow Blog
Learn how to design REST APIs to be easy to understand for anyone, future-proof, secure, and fast since they serve data to clients...
Read more >
Web API implementation - Best practices for cloud applications
Learn about best practices for implementing a web API and publishing it to make it available to client applications.
Read more >
5 Tips to Optimize Your API's Performance - LoadNinja
#1. Cache Requests. Caching is one of the best ways to improve API performance. If you have requests that frequently produce the same...
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