Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiChannelStockLocationStrategy Fails to Clear Cached Channel IDs on StockLocationEvent #3324

Open
dalyathan opened this issue Jan 19, 2025 · 2 comments
Labels
type: bug 🐛 Something isn't working

Comments

@dalyathan
Copy link
Contributor

dalyathan commented Jan 19, 2025

Describe the bug
MultiChannelStockLocationStrategy is not clearing cached channel ids on StockLocationEvent

Expected behavior
MultiChannelStockLocationStrategy should clear cached channel ids on StockLocationEvent

Environment (please complete the following information):

  • @vendure/core version: 3.1.1
  • Nodejs version 22
  • Database (mysql/postgres etc): sqlite, mysql

Additional context
This should be
const channelIds = await this.channelIdCache.get(this.getCacheKey(stockLevel.stockLocationId),
since we are trying to clear cached channel ids by using this.getCacheKey(stockLocationId) in here
This should be

.subscribe(({ entity }) => this.channelIdCache.delete(entity.id));

Since Cache.delete expects id rather than the whole cache key.

@dalyathan dalyathan added the type: bug 🐛 Something isn't working label Jan 19, 2025
@dalyathan
Copy link
Contributor Author

dalyathan commented Jan 21, 2025

I'm want to to contribute a PR for this

@dalyathan dalyathan reopened this Jan 21, 2025
@michaelbromley
Copy link
Member

PR welcome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants