Skip to content

Commit

Permalink
Fix action metadata pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed May 27, 2024
1 parent 1eef7bb commit ab79076
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/NostrConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,11 @@ export default class NostrConnector {
(!action.meta.tags || !filter.tags.some((tag) => action.meta.tags.includes(tag)))
)
continue;
const actionClone = JSON.parse(JSON.stringify(action));
let actionId = JSON.stringify([action.template, action.sockets, action.meta]);
actionId = Utils.uuidFrom(actionId);
action.meta.id = actionId;
actions.set(actionId, action);
actionClone.meta.id = actionId;
actions.set(actionId, actionClone);
} catch (e) {
this.logger.finest("Error filtering discovered action", e);
}
Expand Down

0 comments on commit ab79076

Please sign in to comment.