Skip to content

Commit

Permalink
fix: better type for SandboxFields
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Aug 1, 2023
1 parent 57c0bae commit 9bf4154
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/org/authInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ export class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {

try {
// set the sandbox config value
const sfSandbox = {
const sfSandbox: SandboxFields = {
sandboxUsername: fields.username,
sandboxOrgId: fields.orgId,
prodOrgUsername: possibleProdOrg.username,
sandboxName: sbxProcess.SandboxName,
sandboxProcessId: sbxProcess.Id,
sandboxInfoId: sbxProcess.SandboxInfoId,
timestamp: new Date().toISOString(),
} as SandboxFields;
};

const stateAggregator = await StateAggregator.getInstance();
stateAggregator.sandboxes.set(fields.orgId, sfSandbox);
Expand Down
7 changes: 4 additions & 3 deletions src/org/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export type SandboxFields = {
sandboxUsername?: string;
sandboxProcessId?: string;
sandboxInfoId?: string;
timestamp?: string;
};

/**
Expand Down Expand Up @@ -1298,15 +1299,15 @@ export class Org extends AsyncOptionalCreatable<Org.Options> {
throw messages.createError('AuthInfoOrgIdUndefined');
}
// set the sandbox config value
const sfSandbox = {
const sfSandbox: SandboxFields = {
sandboxUsername: sandboxRes.authUserName,
sandboxOrgId,
prodOrgUsername: this.getUsername(),
prodOrgUsername: this.getUsername() as string,
sandboxName: sandboxProcessObj.SandboxName,
sandboxProcessId: sandboxProcessObj.Id,
sandboxInfoId: sandboxProcessObj.SandboxInfoId,
timestamp: new Date().toISOString(),
} as SandboxFields;
};

await this.setSandboxConfig(sandboxOrgId, sfSandbox);
await (await StateAggregator.getInstance()).sandboxes.write(sandboxOrgId);
Expand Down

2 comments on commit 9bf4154

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: 9bf4154 Previous: 8d2dd7e Ratio
Child logger creation 373898 ops/sec (±44.29%) 523942 ops/sec (±0.66%) 1.40
Logging a string on root logger 553360 ops/sec (±13.70%) 747465 ops/sec (±7.49%) 1.35
Logging an object on root logger 328425 ops/sec (±17.70%) 397936 ops/sec (±17.33%) 1.21
Logging an object with a message on root logger 177367 ops/sec (±21.77%) 218160 ops/sec (±17.73%) 1.23
Logging an object with a redacted prop on root logger 212480 ops/sec (±20.24%) 10390 ops/sec (±198.86%) 0.04889871987951807
Logging a nested 3-level object on root logger 143529 ops/sec (±19.27%) 252589 ops/sec (±14.44%) 1.76

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: 9bf4154 Previous: 8d2dd7e Ratio
Child logger creation 438437 ops/sec (±1.88%) 486356 ops/sec (±5.08%) 1.11
Logging a string on root logger 593182 ops/sec (±16.67%) 570383 ops/sec (±10.92%) 0.96
Logging an object on root logger 353048 ops/sec (±22.10%) 330541 ops/sec (±20.35%) 0.94
Logging an object with a message on root logger 178322 ops/sec (±22.45%) 155760 ops/sec (±24.13%) 0.87
Logging an object with a redacted prop on root logger 214519 ops/sec (±23.88%) 245970 ops/sec (±19.07%) 1.15
Logging a nested 3-level object on root logger 126244 ops/sec (±21.91%) 140285 ops/sec (±20.03%) 1.11

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.