PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: Kong/swrv (ts)
Issue: Get last known state of data if there is no `fn`
In the case, we want to share data between components.

For example, there is an app config needs to be got from network when app is starting.
```
// in component App
const { data: appConfig } = useSWRV('/app/config', configFetcher);
....
// in component B
const { data: appConfig } = useSWRV('/app/config');
```

Pull request description: fix(fetcher) allow optional fetcher to not revalidate
Fixes #48

Patch:
diff --git a/src/use-swrv.ts b/src/use-swrv.ts
index c872697..8a30833 100644
--- a/src/use-swrv.ts
+++ b/src/use-swrv.ts
@@ -101,7 +101,7 @@ type StateRef<Data, Error> = { data: Data, error: Error, isValidating: boolean,
 /**
  * Stale-While-Revalidate hook to handle fetching, caching, validation, and more...
  */
-export default function useSWRV<Data = any, Error = any> (key: IKey, fn: fetcherFn<Data>, config?: IConfig): IResponse<Data, Error> {
+export default function useSWRV<Data = any, Error = any> (key: IKey, fn?: fetcherFn<Data>, config?: IConfig): IResponse<Data, Error> {
   let unmounted = false
   let isHydrated = false
 
@@ -154,6 +154,7 @@ export default function useSWRV<Data = any, Error = any> (key: IKey, fn: fetcher
    */
   const revalidate = async () => {
     const keyVal = keyRef.value
+    if (!fn) return
     if (!isDocumentVisible()) { return }
     const cacheItem = config.cache.get(keyVal, ttl)
     let newData = cacheItem && cacheItem.data


Test patch:
diff --git a/tests/use-swrv.spec.tsx b/tests/use-swrv.spec.tsx
index 0969cb8..a94cee6 100644
--- a/tests/use-swrv.spec.tsx
+++ b/tests/use-swrv.spec.tsx
@@ -228,6 +228,34 @@ describe('useSWRV', () => {
 
     done()
   })
+
+  it('should return cache when no fetcher provided', async done => {
+    let invoked = 0
+    const vm = new Vue({
+      template: `<div>d:{{ data }} cache:{{ dataFromCache }}</div>`,
+      setup  () {
+        const fetcher = () => {
+          invoked += 1
+          return new Promise(res => setTimeout(() => res('SWR'), 200))
+        }
+        const { data } = useSWRV('cache-key-5', fetcher)
+        const { data: dataFromCache } = useSWRV('cache-key-5')
+
+        return { data, dataFromCache }
+      }
+    }).$mount()
+
+    expect(invoked).toBe(1)
+
+    expect(vm.$el.textContent).toBe('d: cache:')
+    expect(invoked).toBe(1)
+    timeout(200)
+    await tick(vm, 2)
+
+    expect(vm.$el.textContent).toBe('d:SWR cache:SWR')
+    expect(invoked).toBe(1) // empty fetcher is OK
+    done()
+  })
 })
 
 describe('useSWRV - loading', () => {
Repository: theupdateframework/go-tuf (go)
Issue: I increase the default `MaxRootRotations` value for the updater config.
The current default value is 32, which is quite small. For some scenarios where the repository is large, a refresh from the first root.json may fail. 
Note that clients *should* cache the metadata, to avoid large number of rotations which is inefficient, and clients *should* embed a "fresh" version of the root to avoid unnecessary rotations, but in some scenarios it's unavoidable, such as when verifying the complete chain of root files. 
Pull request description: Increase the default value for MaxRootRotations
The default value of 32 is quite small, it may break certain clients that are trying to do complete tuf refresh on a large TUF repo.

Closes #644 

Patch:
diff --git a/metadata/config/config.go b/metadata/config/config.go
index 09c9b46..cd8cc98 100644
--- a/metadata/config/config.go
+++ b/metadata/config/config.go
@@ -57,7 +57,7 @@ func New(remoteURL string, rootBytes []byte) (*UpdaterConfig, error) {
 
 	return &UpdaterConfig{
 		// TUF configuration
-		MaxRootRotations:   32,
+		MaxRootRotations:   256,
 		MaxDelegations:     32,
 		RootMaxLength:      512000,  // bytes
 		TimestampMaxLength: 16384,   // bytes


Test patch:
diff --git a/metadata/config/config_test.go b/metadata/config/config_test.go
index be35a87..a5d4874 100644
--- a/metadata/config/config_test.go
+++ b/metadata/config/config_test.go
@@ -43,7 +43,7 @@ func TestNewUpdaterConfig(t *testing.T) {
 			remoteURL: "somepath",
 			rootBytes: []byte("somerootbytes"),
 			config: &UpdaterConfig{
-				MaxRootRotations:      32,
+				MaxRootRotations:      256,
 				MaxDelegations:        32,
 				RootMaxLength:         512000,
 				TimestampMaxLength:    16384,