Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 3.9.1 #1873

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion application/apps/rustcore/ts-bindings/spec/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
"2": "Test 2. Observe configuration (streams)",
"3": "Test 3. Observe configuration (origins)",
"4": "Test 4. Observe configuration (parsers)",
"5": "Test 5. Observe configuration updates (tracking)"
"5": "Test 5. Observe configuration updates (tracking)",
"6": "Test 6. Observe configuration (overwriting)"
},
"files": {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,41 @@ describe('Platform: observing', function () {
next();
});
});

it(config.regular.list[6], function () {
return runner(config.regular, 6, async (logger, done, collector) => {
const observe = new Factory.Stream().asText().serial().get();
checkContext(observe, { file: false, concat: false, stream: true });
const serial = observe.origin.as<$.Origin.Stream.Stream.Serial.Configuration>(
$.Origin.Stream.Stream.Serial.Configuration,
) as $.Origin.Stream.Stream.Serial.Configuration;
expect(serial instanceof $.Origin.Stream.Stream.Serial.Configuration).toEqual(true);
expect(typeof serial.configuration.path).toEqual('string');
const initial = $.Origin.Stream.Stream.Serial.Configuration.initial();
initial.path = '/dev/test';
serial.overwrite(initial);
expect(typeof serial.configuration.path).toEqual('string');
expect(serial.configuration.path).toEqual('/dev/test');
const stream = observe.origin.as<$.Origin.Stream.Configuration>(
$.Origin.Stream.Configuration,
) as $.Origin.Stream.Configuration;
expect(stream instanceof $.Origin.Stream.Configuration).toEqual(true);
stream.change(
new $.Origin.Stream.Stream.Process.Configuration(
$.Origin.Stream.Stream.Process.Configuration.initial(),
undefined,
),
);
const process = observe.origin.as<$.Origin.Stream.Stream.Process.Configuration>(
$.Origin.Stream.Stream.Process.Configuration,
) as $.Origin.Stream.Stream.Process.Configuration;
expect(process instanceof $.Origin.Stream.Stream.Process.Configuration).toEqual(true);
const params = $.Origin.Stream.Stream.Process.Configuration.initial();
params.command = 'test';
process.overwrite(params);
expect(typeof process.configuration.command).toEqual('string');
expect(process.configuration.command).toEqual('test');
finish(undefined, done);
});
});
});
2 changes: 1 addition & 1 deletion application/holder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chipmunk",
"version": "3.9.0",
"version": "3.9.1",
"chipmunk": {
"versions": {}
},
Expand Down
5 changes: 3 additions & 2 deletions application/platform/types/observe/origin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ export class Configuration
{
watcher: this.watcher,
overwrite: ((config: IConfiguration) => {
return this.overwrite(config);
}) as any, /// TODO: <<<<<< VERY BAD!
this.overwrite(config);
return this.configuration[context] as any;
})
},
);
return this;
Expand Down
3 changes: 2 additions & 1 deletion application/platform/types/observe/origin/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export class Configuration
{
watcher: this.watcher,
overwrite: (config: IConfiguration) => {
return this.overwrite(config);
this.overwrite({ [source]: config });
return this.configuration[source];
},
},
);
Expand Down
3 changes: 2 additions & 1 deletion application/platform/types/observe/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export class Configuration
{
watcher: this.watcher,
overwrite: (config: IConfiguration) => {
return this.overwrite(config);
this.overwrite(config);
return this.configuration[protocol];
},
},
);
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.9.1

## Fixes
- fix error related to overwriting configuration of observing (stream/parser)

# 3.9.0

## UI/UX & Features
Expand Down
Loading