Skip to content

Commit e04e0c1

Browse files
authored
feat(release): publish 3.6.1 (#19)
1 parent 249d196 commit e04e0c1

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drata-agent",
3-
"version": "3.6.0",
3+
"version": "3.6.1",
44
"description": "The Drata Agent is a light-weight tray-application that runs in the background, reporting important read-only data to Drata about your machine's state for compliance tracking.",
55
"author": "Drata Inc. <drata@drata.com> (https://drata.com)",
66
"private": true,

src/assets/data/locales/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
"We are making Drata even better than before.": "We are making Drata even better than before.",
7676
"Hide Agent": "Hide Agent",
7777
"Register": "Register",
78-
"Save Diagnostics": "Save Diagnostics",
79-
"Enable Resize": "Enable Resize",
78+
"Save diagnostics": "Save diagnostics",
79+
"Enable resize": "Enable resize",
8080
"Drata Agent update required. Please quit the application to install.": "Drata Agent update required. Please quit the application to install.",
81-
"Send Diagnostics": "Send Diagnostics",
81+
"Send diagnostics": "Send diagnostics",
8282
"Click Okay to send errors to Drata.": "Click Okay to send errors to Drata."
8383
}

src/enums/sync-state.enum.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum SyncState {
22
SUCCESS,
33
ERROR,
44
RUNNING,
5+
UNKNOWN,
56
}

src/main/helpers/auto-launcher.helper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ export class AutoLauncherHelper {
1919
}
2020

2121
const autoLauncher = new AutoLaunch(options);
22-
2322
const isEnabled = await autoLauncher.isEnabled();
2423

25-
if (isEnabled) {
24+
if (isEnabled && !PLATFORM.MACOS) {
2625
await autoLauncher.disable();
2726
await autoLauncher.enable();
2827
} else {

src/main/helpers/axios.helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export class AxiosHelper {
1010
static instance: AxiosHelper = new AxiosHelper();
1111
private readonly dataStore = DataStoreHelper.instance;
1212
private readonly axiosInstance = axios.create();
13+
private readonly REQUEST_TIMEOUT = 5 * 60 * 1000;
1314

1415
private constructor() {
1516
// prepare headers for requests
@@ -23,7 +24,7 @@ export class AxiosHelper {
2324
if (isNil(uuid)) {
2425
this.dataStore.set('uuid', crypto.randomUUID());
2526
}
26-
27+
config.timeout = this.REQUEST_TIMEOUT;
2728
config.baseURL = resolveBaseUrl(region);
2829
config.headers.Authorization = `Bearer ${this.dataStore.get(
2930
'accessToken',

src/main/index.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class DrataAgent {
8484
);
8585
}
8686

87+
this.resolveRunningSyncState(); // shouldn't be running on launch
88+
8789
const hasAccessToken = !!this.dataStore.get('accessToken');
8890
const region = this.dataStore
8991
.get('region')
@@ -162,7 +164,12 @@ class DrataAgent {
162164
// this will not stop jobs already running
163165
app.on('before-quit', this.scheduler.stopAllJobs.bind(this));
164166
powerMonitor.on('suspend', this.scheduler.stopAllJobs.bind(this));
165-
powerMonitor.on('resume', this.scheduler.startAllJobs.bind(this));
167+
powerMonitor.on('resume', () => {
168+
this.resolveRunningSyncState(); // allow new sync on resume
169+
setTimeout(() => {
170+
this.scheduler.startAllJobs();
171+
}, Math.max(config.secondsDelaySyncOnStart, config.secondsDelayUpdateCheckOnStart));
172+
});
166173

167174
// run and schedule app auto update
168175
this.autoUpdate = new AutoUpdateHelper(this.mb, this.bridge);
@@ -192,6 +199,13 @@ class DrataAgent {
192199
}
193200
}
194201

202+
private resolveRunningSyncState() {
203+
if (this.dataStore.get('syncState') === SyncState.RUNNING) {
204+
this.dataStore.set('syncState', SyncState.UNKNOWN);
205+
this.logger.warn('Reset sync to unknown.');
206+
}
207+
}
208+
195209
private installDevTools() {
196210
if (!TARGET_ENV.PROD) {
197211
installExtension(REDUX_DEVTOOLS)
@@ -239,6 +253,7 @@ class DrataAgent {
239253
this.logger.info('System query started.');
240254
const queryResults =
241255
await this.systemQueryService.getSystemInfo();
256+
queryResults.manualRun = manualRun;
242257
this.logger.info('System query successfully completed.');
243258

244259
this.logger.info('Sending query results.');
@@ -268,7 +283,7 @@ class DrataAgent {
268283
private get shouldRunSync(): boolean {
269284
// don't sync while already in progress
270285
if (this.dataStore.get('syncState') === SyncState.RUNNING) {
271-
this.logger.info('Sync aborted. Sync in progress.');
286+
this.logger.info('Sync aborted due to sync already in progress.');
272287
return false;
273288
}
274289

src/main/services/system-query/entities/query-result.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ScreenLockSetting } from './screen-lock-setting-interface';
33
export type QueryResult = {
44
drataAgentVersion: string;
55
platform: 'MACOS' | 'WINDOWS' | 'LINUX';
6+
manualRun?: boolean;
67
rawQueryResults: {
78
osVersion: any;
89
hwSerial: any;

0 commit comments

Comments
 (0)