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.

Compression doesn't seems to be consistent

See original GitHub issue

I was considering updating keyv library to the latest version and switching the custom compression wrapper to one of the new packages. Unfortunately I found couple of potential issues I would like to discuss.

  1. Looks like:
compress?: Record<string, unknown> | undefined;

from Keyv.Options interface are no longer used in code.

  1. New compression parameter used in the Keyv implementation doesn’t seem to have a clear interface that could be used to define the KeyvBrotli, KeyvGzip or any other future implementations.

  2. The approach of using opts object created inside KeyvBrotli and KeyvGzip instead of methods defined by common interface seems to be a dodgy approach. It doesn’t make it easier to work on future integrations.

  3. Both KeyvBrotli and KeyvGzip seems to be defining only two methods in Options interface that when passed to the constructor are immediately overwritten. Additionally compress and decompress methods are being defined in those two classes, which makes it even harder to understand how the code should behave.

  4. I’m not sure if either of those extends EventEmitter implements Store<Value> is really needed in KeyvBrotli and KeyvGzip.

  5. There is not TypeScript compatible way to provide compression-method-related parameters down to the compressors.

I know that’s a lot, but I think current approach is bugged and I would be happy to jump on a call to talk all of those points through.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaredwraycommented, Sep 27, 2022

@kdybicz - will be working on some clean up for this in a pull request and will tag you in on it.

0reactions
jaredwraycommented, Oct 14, 2022

@kdybicz - will be closing this as the v2 architecture is now in main and will be released soon. We decided to keep the overwrite of serialize and deserialize functions in the compress function to simplify the current architecture in Keyv. With that said we will evaluate over time and might move to just needing compress and decompress.

In addition we have added an interface for this to standardize and have updated more of the code to work better and validated it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expert Overview: What Causes Engine Compression Loss ...
In the case that no compression exists at all, it means a more severe mechanical problem occurred, causing your engine not even to...
Read more >
5 Crucial Mistakes People Make Compressing Vocals
1. Relying on Compression Alone. For modern sounding vocals, you need a crazy amount of dynamic consistency. Every word needs to be loud...
Read more >
Audacity: Fixing Inconsistent Volume (Compressor)
Navigate to Effect > Compressor. A new window will appear. Adjust the Compressor settings. Threshold: The level above which compression is ...
Read more >
How to Use Compression to Solve 5 Common Mixing Mistakes
Compression is a tool that will solve problems in your mix. Learn how to use compression to make your track sound better.
Read more >
How To Use a Compressor: The Easy To Follow Guide (10 ...
Sometimes this is desirable, but in most cases it isn't. We usually use a compressor to catch the louder peaks and make the...
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