[BUG]: the Available cache ignores the environment, so one setting's list is shown for another

オープン
#816 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@nanami7777777 がすでに取り組んでいます。

2026年11月22日 から。

  • #817 @nanami7777777 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
go
領域
cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

bug

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.

主要言語
Go
スター
4k
フォーク
177
平均マージ
1日 20時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

version-fox/vfox のほかの issue

version-fox/vfox の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。