forked from farhoodlabs/paperclip
92afa0fb67
Add an async mutex (promise-chain FIFO queue) to serialise all adapter mutation routes (install, reinstall, reload, delete) so that concurrent requests cannot race on npm, the adapter-plugins.json store, or the in-memory adapter registry. Also switch adapter-plugin-store file writes to atomic write-tmp-then-rename to prevent partial/corrupted reads from concurrent processes. Includes the packageName.trim() fix for whitespace-induced npm failures. 9 new tests covering mutex serialisation, error recovery, FIFO ordering, and atomic store operations. Co-Authored-By: Paperclip <noreply@paperclip.ing>