my-provider-dash-manager 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/main.js +26 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-provider-dash-manager",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "CLI to install and update My Provider Dash Manager: a free Windows desktop app that keeps many accounts per service (Vercel, Netlify, Supabase, Cloudflare, AWS, Google, Microsoft, GitHub, Gmail) signed in at once, each in a fully isolated session. Also available as mpdm.",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
package/src/main.js CHANGED
@@ -1218,16 +1218,35 @@ async function runSmokeCreds() {
1218
1218
  const sibling = copyCredentialField(otherAcct.id, 'password', 'vercel', 'team-a', 'https://vercel.com/login');
1219
1219
  check('copy-refused-another-accounts-capture', sibling.ok === false && sibling.reason === 'other-account', `reason=${sibling.reason}`);
1220
1220
  clipboard.clear();
1221
- // the real copy path: main writes the clipboard, and the answer is a label — never the secret
1221
+ // WARM-UP WRITE (required): on this machine the first writeText after clear() in a fresh
1222
+ // process does not yet round-trip through readText — this sentinel is what makes the very
1223
+ // first read-back reliable at all (proved 2026-11-03: removing it made every copy check fail).
1224
+ // A cold machine (the day's first run) can still be slow even with the warm-up, hence the poll.
1222
1225
  clipboard.writeText('sentinel-before-copy');
1226
+ // the real copy path: main writes the clipboard, and the answer is a label — never the secret.
1227
+ // A cold machine can take a moment before the Win32 clipboard returns what was just written
1228
+ // (observed 2026-11-03: the day's first suite run read back stale values; every rerun passed),
1229
+ // so poll the read-back and retry the write once — a genuine write regression still fails hard.
1230
+ const clipboardSettles = async (doWrite, expected) => {
1231
+ let last = null;
1232
+ for (let attempt = 0; attempt < 2; attempt++) {
1233
+ last = doWrite();
1234
+ const deadline = Date.now() + 2500;
1235
+ while (Date.now() < deadline) {
1236
+ if (clipboard.readText() === expected) return { last, text: clipboard.readText() };
1237
+ await new Promise(r => setTimeout(r, 50));
1238
+ }
1239
+ }
1240
+ return { last, text: clipboard.readText() };
1241
+ };
1223
1242
  const sharedRow = siteA.rows.find(r => r.username === 'shared@example.com');
1224
- const copied = copyCredentialField(sharedRow.id, 'password', 'vercel', 'team-a', 'https://vercel.com/login');
1243
+ const pw = await clipboardSettles(() => copyCredentialField(sharedRow.id, 'password', 'vercel', 'team-a', 'https://vercel.com/login'), 'shared-pw');
1225
1244
  check('copy-writes-the-right-password-to-the-clipboard',
1226
- copied.ok === true && clipboard.readText() === 'shared-pw' && !JSON.stringify(copied).includes('shared-pw'),
1227
- `ok=${copied.ok} label="${copied.label}" clipboard-match=${clipboard.readText() === 'shared-pw'}`);
1228
- const copiedUser = copyCredentialField(sharedRow.id, 'username', 'vercel', 'team-a', 'https://vercel.com/login');
1229
- check('copy-email-writes-the-username', copiedUser.ok === true && clipboard.readText() === 'shared@example.com',
1230
- `label="${copiedUser.label}"`);
1245
+ pw.last.ok === true && pw.text === 'shared-pw' && !JSON.stringify(pw.last).includes('shared-pw'),
1246
+ `ok=${pw.last.ok} label="${pw.last.label}" clipboard-match=${pw.text === 'shared-pw'}`);
1247
+ const mail = await clipboardSettles(() => copyCredentialField(sharedRow.id, 'username', 'vercel', 'team-a', 'https://vercel.com/login'), 'shared@example.com');
1248
+ check('copy-email-writes-the-username', mail.last.ok === true && mail.text === 'shared@example.com',
1249
+ `label="${mail.last.label}" clipboard-match=${mail.text === 'shared@example.com'}`);
1231
1250
  const badField = copyCredentialField(sharedRow.id, 'reveal', 'vercel', 'team-a', 'https://vercel.com/login');
1232
1251
  check('copy-refuses-an-unknown-field', badField.ok === false && badField.reason === 'bad-field', `reason=${badField.reason}`);
1233
1252
  clipboard.clear();