@bli-cockpit/cli 0.2.19 → 0.2.20

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.
package/dist/autostart.js CHANGED
@@ -10,6 +10,16 @@ const WINDOWS_AUTOSTART_SCRIPT_NAME = "autostart-sync.ps1";
10
10
  const WINDOWS_AUTOSTART_REGISTRATION_SCRIPT_NAME = "autostart-register.ps1";
11
11
  const UTF8_BOM = "\uFEFF";
12
12
  export const DEFAULT_AUTOSTART_INTERVAL_SECONDS = 15 * 60;
13
+ /**
14
+ * macOS rewrites this file on every network transition (join, leave, DNS
15
+ * change), so watching it retries spooled uploads the moment connectivity
16
+ * returns instead of waiting out the StartInterval \u2014 the lid-closed-mid-upload
17
+ * machine hopping caf\u00E9s is where most historical upload failures came from
18
+ * (BLI-2604). The real file, not the /etc/resolv.conf symlink: launchd watches
19
+ * the path it is given, and the symlink itself never changes. Burst fires are
20
+ * cheap \u2014 the collection lock turns overlap into a named no-op.
21
+ */
22
+ export const DARWIN_NETWORK_CHANGE_SIGNAL = "/private/var/run/resolv.conf";
13
23
  const UNSUPPORTED_MESSAGE = "autostart is supported on macOS and Windows only";
14
24
  function plistPathFor(homeDir) {
15
25
  return path.join(homeDir, "Library", "LaunchAgents", `${AUTOSTART_LABEL}.plist`);
@@ -49,8 +59,13 @@ export async function installAutostartAgent(options) {
49
59
  const stderrPath = path.join(paths.state_dir, "sync.err.log");
50
60
  // launchd will not reliably watch a path that does not exist at load time, so
51
61
  // only feed it the transcript dirs that are present right now. A missing dir
52
- // is fine — the StartInterval floor still covers it.
53
- const watchPaths = await existingWatchPaths(homeDir);
62
+ // is fine — the StartInterval floor still covers it. The network signal is
63
+ // appended unconditionally: it always exists on the Macs this plist targets,
64
+ // and an existence filter would drop it when rendering on another host.
65
+ const watchPaths = [
66
+ ...(await existingWatchPaths(homeDir)),
67
+ DARWIN_NETWORK_CHANGE_SIGNAL,
68
+ ];
54
69
  await mkdir(path.dirname(plistPath), { recursive: true });
55
70
  await mkdir(paths.state_dir, { recursive: true });
56
71
  await writeFile(plistPath, renderPlist({
@@ -15,7 +15,7 @@ export async function runCockpitCli(argv, io) {
15
15
  }
16
16
 
17
17
  if (command === "--version" || command === "-V" || command === "version") {
18
- writeLine(io?.stdout ?? process.stdout, "0.2.19");
18
+ writeLine(io?.stdout ?? process.stdout, "0.2.20");
19
19
  return 0;
20
20
  }
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {