[BUG]: the Available cache ignores the environment, so one setting's list is shown for another
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
The cache key is built in Available in internal/sdk/sdk.go from the search args. Check linked pull request #817 first, since it already targets this, and the maintainers have not yet chosen between the three proposed fixes. Reproduce by running vfox search with and without a changed environment variable and watching the .available.cache file. Done means a search under one environment never returns a result the hook produced under another.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
vfox 1.1.0
OS
Linux (x86_64)
Describe the bug
vfox search caches the result of a plugin's Available hook in <VFOX_HOME>/plugin/<name>/.available.cache for cache.availableHookDuration (12 hours by default). The cache key is only the search arguments: in internal/sdk/sdk.go, Available uses cacheKey := strings.Join(args, "##"), or empty when there are none. The environment is not part of the key. A plugin whose hook reads an environment variable therefore gets the first result back for every value of that variable until the cache expires.
We found this while working on version-fox/vfox-elixir#22. The plugin's Available hook returns the release list, or the hex.pm builds list when VFOX_ELIXIR_MIRROR=hex is set.
To reproduce
$ vfox search elixir # release list
Available versions:
- 1.20-latest
- 1.19-latest
...
$ VFOX_ELIXIR_MIRROR=hex vfox search elixir # the same release list, from the cache
Available versions:
- 1.20-latest
...
$ rm <VFOX_HOME>/plugin/elixir/.available.cache
$ VFOX_ELIXIR_MIRROR=hex vfox search elixir # now the hook runs
Available versions:
- main (pre-built from hex.pm)
...
Setting cache.availableHookDuration to 0s also makes the second search call the hook.
Expected
A search under one environment should not show a result that the hook produced under another. Possible directions: include the values of the environment variables a hook reads in the cache key, let a plugin mark its Available result as not cacheable, or give a plugin a cache key of its own. Errors returned by the hook are not cached today, which is correct.
- Lingua principale
- Go
- Stelle
- 4k
- Fork
- 177
- Merge medio
- 1g 20h
- PR unite (30g)
- 31
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di version-fox/vfox
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
version-fox/vfox#825 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
version-fox/vfox#823 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
version-fox/vfox#824 ·
I maintainer di solito rispondono entro 1 giorno
-
Plugins fail to load when the HOME path contains ';' or '?' (Lua package.path)Forse già presa @Xnadir l’ha presa oggi. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
version-fox/vfox#821 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: treat two names of one install as the same versionForse già presa @Detoy l’ha presa oggi. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
version-fox/vfox#814 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di version-fox/vfox
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
seaweedfs/seaweed-block#443 ·
I maintainer di solito rispondono entro 1 giorno
-
HTTP `batch.Send` returns nil and inserts no rows when the block does not encodeForse già presa @Indian-boult l’ha presa oggi. Apertabug queries
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ClickHouse/clickhouse-go#2155 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
transparency-dev/tessera#1286 ·
I maintainer di solito rispondono entro 1 giorno