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.

Need to regenerate records if `matchRequestsBy` changes

See original GitHub issue

Description

If I understand things correctly, having the id hardcoded in the har files makes it so that when matchRequestBy changes no entry is valid. The recordings are in fact still viable but since the id is generated based on matchRequestBy all recordings need to be recreated.

That becomes a big problem when you have a lot of recordings, even the slightest change to matchRequestBy requires to regenerate everything!

I use matchRequestBy to ignore things that are dynamic or may change between two runs. Dates, tokens, some ids, etc… The config is mostly very static but in the case where it needs to change it creates a massive break.

What I would like to see is har files be a pure raw recording of the requests and be independant of the matchRequestBy.

Shareable Source

All entries in har files have this:

{
  "_id": "1f62d02515e4ee31cf40fafc4d01f127",
  "request": ...
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:11

github_iconTop GitHub Comments

1reaction
jasonmitcommented, Sep 18, 2019

@stephenh _id could be computed at runtime it’s just not the implementation today.

If there is enough interest, I think we could make the necessary changes but the work involved to get there is pretty significant.

1reaction
skimicommented, May 3, 2019

They already are. The ID is generated every time a request goes through Polly and is stored with the recording.

What I mean by when pollyjs starts is when the persister is instantiated. At that time it could generate the id for all its records (might be long, don’t know). That way the id would always be generated with the latest matchRequestsBy config.

If the ID changes, we have no way of knowing if the previous recorded data is still valid so the safest assumption is to fetch a new one that will then truly match the ID.

Since the har file is a raw recording of the request it would still have all the necessary information needed to generate a new ID that would match the new matchRequestsBy setting. Instead of fetching again regenerate the IDs for the existing recordings. Then maybe fetch if it still does not match.

Anyway, I know it’s an edge case. My first assumption that any changes to matchRequestBy require a record of everything is actually false. Requests that are not affected by the change won’t actually need to be re-fetched. I just had a case where a single change affected everything.

If possible, maybe pollyjs could not hardcode the id in the har-file. That would avoid a few fetch sometimes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regenerate Records artists & music download
Log in to start using My Beatport! My Beatport lets you follow your favorite DJs and labels so you can find out when...
Read more >
ChangeLog-certified-13.21-cert6 - Index of / - Asterisk.org
NOTE: This change required that the rest of the CI shell scripts and ... Richard Mudgett <rmudgett@digium.com> * cdr.c: Fix runtime leak of...
Read more >
Microsoft Access Backup Record Before Edited ... - YouTube
... going to show you how to back up a record in your database before someone makes changes to it. This way you...
Read more >
Nicolas Menicou - Cosmic Love (Extended Mix ... - YouTube
J'AIME TRANCE on Spotify https://spoti.fi/3oX6LVkRelease: 19-08-2022Label: REGENERATE RECORDSCatalog N° RGEN118Buy: ...
Read more >
Atcom.git - INetFactory.com
1776, bundled pjproject needs to be rebuild before other parts of Asterisk. 1777. 1778, Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e.
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