Skip to content

Commit 7339667

Browse files
committed
feat: changed behaviour from @ref (AnWeber/vscode-httpyac#336)
1 parent 1274d8e commit 7339667

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## [6.16.3] (2024-10-30)
2+
3+
### Fix
4+
- revert: named response is only set, if all testResults are valid
5+
- changed behaviour from `@ref` (AnWeber/vscode-httpyac#336)
6+
- negative test results from reference does not stop dependent request
7+
- errored reference is not executed multiple times if it is referenced multiple times
8+
9+
10+
## [6.16.2] (2024-10-29)
11+
12+
### Fix
13+
- named response is only set, if all testResults are valid
14+
15+
116
## [6.16.1] ( 2024-10-29)
217

318
### Fix

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"publisher": "AnWeber",
66
"description": "HTTP/REST CLI Client for *.http files",
7-
"version": "6.16.1",
7+
"version": "6.16.3",
88
"homepage": "https://github.com/AnWeber/httpyac",
99
"repository": {
1010
"type": "git",

src/plugins/core/metaData/refMetaDataHandler.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@ class RefMetaAction {
3939
const envKey = utils.toEnvironmentKey(context.activeEnvironment);
4040
utils.setVariableInContext(reference.variablesPerEnv[envKey], context);
4141
log.trace('import variables', reference.variablesPerEnv[envKey]);
42-
if (this.data.force || utils.isUndefined(context.variables[name])) {
42+
43+
const isNotExecuted =
44+
utils.isUndefined(context.variables[name]) && !context.processedHttpRegions?.some(p => p.id === reference.id);
45+
if (this.data.force || isNotExecuted) {
4346
result = await reference.execute(context);
4447
if (result) {
4548
// ref to ref variable export
4649
utils.setVariableInContext(reference.variablesPerEnv[envKey], context);
47-
} else if (
48-
reference.testResults &&
49-
reference.testResults.some(t => t.status !== models.TestResultStatus.SUCCESS)
50-
) {
51-
utils.addSkippedTestResult(context.httpRegion);
5250
}
5351
}
5452
} else {

src/store/httpRegion.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ export class HttpRegion implements models.HttpRegion {
8989
if (!this.isGlobal()) {
9090
this.resetDependentRegionsWithVisitor(toEnvironmentKey(context.activeEnvironment), this, []);
9191
}
92-
const isNotCanceled = result !== HookCancel && result.every(obj => !!obj);
93-
const hasOnlySucessTestResults =
94-
!this.testResults.length || this.testResults.every(t => t.status === models.TestResultStatus.SUCCESS);
95-
return isNotCanceled && hasOnlySucessTestResults;
92+
return result !== HookCancel && result.every(obj => !!obj);
9693
} catch (err) {
9794
if (isError(err)) {
9895
if (!err.handled) {

0 commit comments

Comments
 (0)