fix: close marketplace client review findings
This commit is contained in:
@@ -175,6 +175,21 @@ export class AccountPluginCache {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forget device-resolution snapshots for one plugin in one account binding.
|
||||
* The Library projection is intentionally retained so uninstalling a device
|
||||
* package never becomes an account Library mutation.
|
||||
*/
|
||||
invalidatePlugin(binding: AccountBinding, pluginId: string): void {
|
||||
const record = this.records.get(bindingId(binding));
|
||||
if (!record) return;
|
||||
for (const [key, snapshot] of record.resolves.entries()) {
|
||||
const items = snapshot.items.filter((item) => item.pluginId !== pluginId);
|
||||
if (items.length === 0) record.resolves.delete(key);
|
||||
else if (items.length !== snapshot.items.length) record.resolves.set(key, { ...snapshot, items });
|
||||
}
|
||||
}
|
||||
|
||||
clearAccount(binding: AccountBinding): void {
|
||||
assertBinding(binding);
|
||||
for (const [key, record] of this.records.entries()) {
|
||||
|
||||
Reference in New Issue
Block a user