Skip to content

Conversation

@timokoessler
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Member

@bitterpanda63 bitterpanda63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@timokoessler timokoessler changed the title Cache forceProtectionOff in context Cache matching endpoints in context Apr 2, 2025
}
const endpoints = matchEndpoints(context, this.nonGraphQLEndpoints);
// Cache the endpoints to avoid re-running the matchEndpoints function
updateContext(context, "cachedMatchingEndpoints", endpoints);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function modifies input parameter 'context' by caching endpoints, creating unexpected side effects. More info


getEndpoints(context: LimitedContext) {
return matchEndpoints(context, this.nonGraphQLEndpoints);
getEndpoints(context: Context): Endpoint[] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function mixes endpoint matching logic with caching infrastructure concerns. More info

context.cache.delete(key);
}

// Delete cacheMatchingEndpoints if method, url, or route changes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment restates obvious code mechanics without explaining why cache invalidation is needed. More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants