Skip to content

refactor(networkcache): adding one more safety check#1468

Merged
korgon merged 2 commits into
developfrom
improvements
Mar 18, 2026
Merged

refactor(networkcache): adding one more safety check#1468
korgon merged 2 commits into
developfrom
improvements

Conversation

@chrisFrazier77

Copy link
Copy Markdown
Contributor

No description provided.

korgon
korgon previously approved these changes Mar 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens NetworkCache.set() behavior to ensure the cache never grows beyond the configured maxSize when purging cannot free enough space (e.g., no purgeable entries remain).

Changes:

  • Add a post-purge size check to skip caching when the new entry still won’t fit within maxSize.
  • Emit a warning when an entry is skipped after unsuccessful purging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/snap-client/src/Client/NetworkCache/NetworkCache.ts
Comment thread packages/snap-client/src/Client/NetworkCache/NetworkCache.ts
@korgon korgon merged commit 02362b3 into develop Mar 18, 2026
1 check passed
@korgon korgon deleted the improvements branch March 18, 2026 00:39
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