dashcam 1.3.15-beta → 1.3.16-beta

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.
@@ -11,8 +11,8 @@ import fs from 'fs';
11
11
  import path from 'path';
12
12
  import os from 'os';
13
13
 
14
- // Get process directory for status files
15
- const PROCESS_DIR = path.join(os.homedir(), '.dashcam-cli');
14
+ // Get process directory for status files (system temp for cross-session access)
15
+ const PROCESS_DIR = path.join(os.tmpdir(), 'dashcam-cli');
16
16
  const STATUS_FILE = path.join(PROCESS_DIR, 'status.json');
17
17
  const RESULT_FILE = path.join(PROCESS_DIR, 'upload-result.json');
18
18
 
@@ -28,6 +28,13 @@ const options = JSON.parse(optionsJson);
28
28
  // Enable verbose logging in background
29
29
  setVerbose(true);
30
30
 
31
+ console.log('[Background] Process started', {
32
+ pid: process.pid,
33
+ platform: process.platform,
34
+ processDir: PROCESS_DIR,
35
+ statusFile: STATUS_FILE
36
+ });
37
+
31
38
  logger.info('Background recording process started', {
32
39
  pid: process.pid,
33
40
  options
@@ -43,7 +50,7 @@ function writeStatus(status) {
43
50
  platform: process.platform
44
51
  };
45
52
 
46
- logger.debug('Background process writing status file', {
53
+ console.log('[Background] Writing status file:', {
47
54
  statusFile: STATUS_FILE,
48
55
  pid: statusData.pid,
49
56
  isRecording: statusData.isRecording,
@@ -54,18 +61,20 @@ function writeStatus(status) {
54
61
 
55
62
  // Verify it was written
56
63
  if (fs.existsSync(STATUS_FILE)) {
57
- logger.debug('Status file written and verified', { statusFile: STATUS_FILE });
64
+ console.log('[Background] Status file written and verified:', STATUS_FILE);
58
65
 
59
66
  // Read it back to verify content
60
67
  const writtenContent = fs.readFileSync(STATUS_FILE, 'utf8');
61
- logger.debug('Status file content verification', {
68
+ console.log('[Background] Status file content verification:', {
62
69
  contentLength: writtenContent.length,
63
70
  parseable: true
64
71
  });
65
72
  } else {
73
+ console.error('[Background] Status file does not exist after write!', STATUS_FILE);
66
74
  logger.error('Status file does not exist after write!', { statusFile: STATUS_FILE });
67
75
  }
68
76
  } catch (error) {
77
+ console.error('[Background] Failed to write status file:', error.message);
69
78
  logger.error('Failed to write status file in background process', {
70
79
  error: error.message,
71
80
  stack: error.stack,
@@ -102,9 +111,12 @@ async function runBackgroundRecording() {
102
111
  };
103
112
 
104
113
  logger.info('Starting recording with options', { recordingOptions });
114
+ console.log('[Background] Starting recording with options:', recordingOptions);
105
115
 
106
116
  recordingResult = await startRecording(recordingOptions);
107
117
 
118
+ console.log('[Background] Recording started, writing status file...');
119
+
108
120
  // Write status to track the recording
109
121
  writeStatus({
110
122
  isRecording: true,
@@ -118,6 +130,12 @@ async function runBackgroundRecording() {
118
130
  outputPath: recordingResult.outputPath,
119
131
  startTime: recordingResult.startTime
120
132
  });
133
+
134
+ console.log('[Background] Recording started successfully', {
135
+ outputPath: recordingResult.outputPath,
136
+ startTime: recordingResult.startTime,
137
+ pid: process.pid
138
+ });
121
139
 
122
140
  // Set up signal handlers for graceful shutdown
123
141
  const handleShutdown = async (signal) => {
package/bin/dashcam.js CHANGED
@@ -399,7 +399,7 @@ program
399
399
  platform: process.platform,
400
400
  cwd: process.cwd(),
401
401
  pid: process.pid,
402
- processDir: require('os').homedir() + '/.dashcam-cli'
402
+ processDir: require('path').join(require('os').tmpdir(), 'dashcam-cli')
403
403
  });
404
404
 
405
405
  const isActive = processManager.isRecordingActive();
@@ -409,13 +409,13 @@ program
409
409
  console.log('No active recording to stop');
410
410
  logger.warn('Stop command called but no active recording found', {
411
411
  platform: process.platform,
412
- statusFile: require('path').join(require('os').homedir(), '.dashcam-cli', 'status.json'),
413
- statusFileExists: require('fs').existsSync(require('path').join(require('os').homedir(), '.dashcam-cli', 'status.json'))
412
+ statusFile: require('path').join(require('os').tmpdir(), 'dashcam-cli', 'status.json'),
413
+ statusFileExists: require('fs').existsSync(require('path').join(require('os').tmpdir(), 'dashcam-cli', 'status.json'))
414
414
  });
415
415
 
416
416
  // Try to read and display status file for debugging
417
417
  try {
418
- const statusPath = require('path').join(require('os').homedir(), '.dashcam-cli', 'status.json');
418
+ const statusPath = require('path').join(require('os').tmpdir(), 'dashcam-cli', 'status.json');
419
419
  if (require('fs').existsSync(statusPath)) {
420
420
  const statusContent = require('fs').readFileSync(statusPath, 'utf8');
421
421
  logger.debug('Status file contents', { content: statusContent });
@@ -423,6 +423,7 @@ program
423
423
  console.log('Status file location:', statusPath);
424
424
  } else {
425
425
  console.log('Status file does not exist');
426
+ console.log('Expected status file location:', statusPath);
426
427
  }
427
428
  } catch (err) {
428
429
  logger.error('Failed to read status file for debugging', { error: err.message });
@@ -8,8 +8,8 @@ import { logger } from './logger.js';
8
8
  const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = path.dirname(__filename);
10
10
 
11
- // Use a fixed directory in the user's home directory for cross-process communication
12
- const PROCESS_DIR = path.join(os.homedir(), '.dashcam-cli');
11
+ // Use system temp directory for cross-session communication
12
+ const PROCESS_DIR = path.join(os.tmpdir(), 'dashcam-cli');
13
13
  const STATUS_FILE = path.join(PROCESS_DIR, 'status.json');
14
14
  const RESULT_FILE = path.join(PROCESS_DIR, 'upload-result.json');
15
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashcam",
3
- "version": "1.3.15-beta",
3
+ "version": "1.3.16-beta",
4
4
  "description": "Minimal CLI version of Dashcam desktop app",
5
5
  "main": "bin/dashcam.js",
6
6
  "bin": {