Fix resource refresh button not triggering re-fetch#1148
Draft
olaservo wants to merge 1 commit intomodelcontextprotocol:mainfrom
Draft
Fix resource refresh button not triggering re-fetch#1148olaservo wants to merge 1 commit intomodelcontextprotocol:mainfrom
olaservo wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
…ocol#1120) The readResource function had an early return when the resource URI was already cached, preventing the Refresh button from re-fetching. Add a force parameter to bypass the cache on refresh, and update the cache-hit path to still sync the displayed content when switching between previously viewed resources. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1120
readResourcefunction had an early return when the resource URI was already inresourceContentMap, which prevented the Refresh button from ever re-fetchingforceparameter toreadResourceto bypass the cache when the Refresh button is clickedChanges
client/src/App.tsx— Addedforceparameter toreadResource; forwarded it through the prop wrapperclient/src/components/ResourcesTab.tsx— Updated type signature; Refresh button now passesforce=trueclient/e2e/resource-refresh.spec.ts— New Playwright e2e test verifying the refresh button triggers a newresources/readrequestTest plan
npx jest --testPathPattern ResourcesTab— 10/10)npx tsc --noEmit)@modelcontextprotocol/server-everything, lists resources, clicks one, clicks Refresh, verifies newresources/readin history)🦉 Generated with Claude Code