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.

Cache feature does not work

See original GitHub issue

Describe the bug Running betterer with --cache flag multiple times does not actually make anything calculate faster. Despite code not being changed, all comands run and for example recompile Typescript.

To Reproduce If possible please share a repo with the issue, or another repository which demonstrates the issue. If possible please include the .betterer.ts file, and the .betterer.results file if applicable. At a minimum please share the command you are using to run Betterer.

Expected behavior Running command twice with --cache flag makes second run instant.

Screenshots CleanShot 2021-12-10 at 23 31 13@2x

Versions (please complete the following information):

System:

  • OS: macOS 11.6
  • Memory: 35.78 MB / 16.00 GB

Binaries:

  • Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
  • Yarn: 1.22.17 - /usr/local/bin/yarn
  • npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm

Languages:

  • Bash: 3.2.57 - /bin/bash

Betterer:

  • 5.0.0-alpha.0

Debug log: CleanShot 2021-12-10 at 23 33 40@2x

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Gieschcommented, Apr 13, 2022

If it was a problem with betterer’s file caching, I think it would be either:

  1. A change to an export in file A causes the cached file B to no longer compile, but B’s cache wasn’t busted, or
  2. Changing between branches didn’t clear the cache, so incorrect data was in the cache

But the more likely explanation in our case is that code that didn’t pass the betterer ci check made it into master.

As far as caching goes, it was definitely faster; tsc might be able to more reliably address 1 & 2 above, or betterer might be addressing them well enough, I don’t know. My only guess would be that 1 is trickier than it looks because it can involve type inference as well as exports/imports. Like, a change to a type can break files that import related functions but don’t import the type itself. But the fact that we had a problem does not mean that 1 or 2 was the problem.

0reactions
jimmy-guzmancommented, May 26, 2022

Not sure if this is related but were facing something similar with betterer cache when changing branches. If we change to a new branch sometimes betterer cache fails with errors that seem like some types are missing from external libs.

Deleting the cache or bypassing the cache results in no errors.

We ended up not using the cache for typescript for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is caching not working? - Help Center - Servebolt.com
When cache is not working as expected, the first thing you want to check is to see wether any caching is happening at...
Read more >
Fixed: Google Chrome is waiting for cache issue on Windows 10
Don't continue waiting for the cache issue on Windows 10 to clear on Google. Use these simple troubleshooting solutions to fix the issue...
Read more >
What is a cache? And why does clearing it fix things? - Zapier
That's all the cache is: the place where your browser stores images, code, and other files to avoid re-downloading them repeatedly. Your browser ......
Read more >
TroubleShooting: Dynamic cache - IBM
Troubleshooting for dynamic cache problems with WebSphere Application Server. This should help address common issues with this component ...
Read more >
Identifying 10 common web site caching issues and their ...
SOLUTION: Can be resolved by clearing browser cache and restarting browser. Sometimes, even a simple hard refresh without restarting a browser ...
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