(key, disk, next)
| 102 | } |
| 103 | |
| 104 | function canApplyPartialNodeSecretTupleWrite(key, disk, next) { |
| 105 | if (key !== 'node_secret_version') return false; |
| 106 | if (!isHubRotatedNodeSecretState(disk)) return true; |
| 107 | if (!isHubRotatedNodeSecretState(next)) return false; |
| 108 | if (String(next.node_secret).trim() !== String(disk.node_secret).trim()) return false; |
| 109 | const nextVersion = parseNodeSecretVersion(next.node_secret_version); |
| 110 | const diskVersion = parseNodeSecretVersion(disk.node_secret_version); |
| 111 | return Boolean(nextVersion && (!diskVersion || nextVersion >= diskVersion)); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * @param {string} stateFile |
no test coverage detected