tagreeve 0.9.0 → 0.9.2
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.
- package/CHANGELOG.md +51 -2
- package/README.md +5 -1
- package/dist/cli.js +72 -29
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
`npm i -g tagreeve` installs this release. 0.9.2 is a patch release after 0.9.1. It has no new command, option or record field. The record stays at schema version 5. A 0.9.1 record reads as before.
|
|
6
|
+
|
|
7
|
+
### Fixes in 0.9.2
|
|
8
|
+
|
|
9
|
+
- `pinterest-capi`: a `body.only` rule no longer fails on the five transport fields of the call (#1662, #1677).
|
|
10
|
+
- Baseline: a gcd letter split with a count change is now a count change in the baseline, not drift (#1599, #1678).
|
|
11
|
+
- Variables: an undeclared `{name}` inside a variable value prints a warning on stderr. The run still exits as before (#1673, #1676).
|
|
12
|
+
- Cleanups to tests and comments for the hash label guard. No behaviour change (#1600, #1675).
|
|
13
|
+
|
|
14
|
+
### Upgrading from 0.9.1
|
|
15
|
+
|
|
16
|
+
- **A `body.only` rule on `pinterest-capi` that failed now passes.** The rule failed on the five transport fields of the call. A suite that was red for that reason turns green.
|
|
17
|
+
- **A gcd letter split with a count change is no longer drift.** A `run --baseline` that exited 1 for it now passes. The related split case still reports drift (#1599).
|
|
18
|
+
- **A new warning line on stderr.** A run with an undeclared `{name}` in a variable value that the start URL or a visit path uses prints it. The exit code and stdout do not change. A script that treats any stderr output as a failure sees it.
|
|
19
|
+
- **A new release needs a new server image.** On arm64 (Apple silicon), run `tagreeve server-container build` after `npm i -g tagreeve`. A run with `--server-container` exits 2 with "The image tagreeve-sgtm:<version> is not available" until the image for that version exists. On amd64 the command builds nothing.
|
|
20
|
+
|
|
21
|
+
### Known in 0.9.2
|
|
22
|
+
|
|
23
|
+
Issues still open that you can meet, in addition to those in 0.7.0:
|
|
24
|
+
|
|
25
|
+
- The canary search reads only the forms it lists. It skips gzip and binary bodies, bodies cut at 64 KiB and net-log requests with no body, and it does not search headers. A pass means no planted value was found in the searched forms.
|
|
26
|
+
- The Stape loader unwrap covers `/g/collect` and `/data`. Stape's hosting layer may act on a loader request in other ways, and the record says so in fixed text.
|
|
27
|
+
- A gcd letter split of a gone tuple into two new variants still reports drift (#1599).
|
|
28
|
+
- The two vendor name tables, `VENDOR_NAMES` and `HASH_REQUIRED_VENDORS`, are still separate (#1485). A guard test fails when a vendor in the second has no label.
|
|
29
|
+
|
|
30
|
+
## 0.9.1
|
|
31
|
+
|
|
32
|
+
`npm i -g tagreeve` installs this release. 0.9.1 is a patch release after 0.9.0. It has no new command, option or record field. The record stays at schema version 5. A 0.9.0 record reads as before.
|
|
33
|
+
|
|
34
|
+
### Fixes in 0.9.1
|
|
35
|
+
|
|
36
|
+
- Variables: a `{name}` inside a variable value is now filled, three levels deep too, in the start URL and in every visit path. A variable cycle exits 2 before the recorder starts and names the place and the variables, never a value. A canary run plants the canaries on the fully filled start (#1666, #1671).
|
|
37
|
+
- `identifierRoute`: a padded Base64 SHA-256 digest of a canary or of the identity email now reads transform `sha256`, as the unpadded digest does. A canary followed by `=` reads `plain` (#1667, #1670).
|
|
38
|
+
|
|
39
|
+
### Upgrading from 0.9.0
|
|
40
|
+
|
|
41
|
+
- **A nested variable now opens the filled page, so checks can fail where they passed.** A start URL or visit path that used a variable holding a `{name}` opened the literal `%7Bname%7D` path in 0.9.0, and the run could exit 0 on the wrong page. It now opens the filled page, and the rules run against that page.
|
|
42
|
+
- **A variable cycle exits 2.** A cycle made by `{a}` and `{b}` pointing at each other, in the config or in a `--var` value, stops the run before the recorder starts.
|
|
43
|
+
- **A `#` in a used variable now runs.** 0.9.0 refused a canary run when a used variable held a `#` and another variable held a `{name}`. It now runs, with the canaries planted before the `#`.
|
|
44
|
+
- **A padded digest reads `sha256` and a canary followed by `=` reads `plain`.** Report rows and route lines that were split between `other` and the plain form now merge. No verdict changes.
|
|
45
|
+
- **A new release needs a new server image.** On arm64 (Apple silicon), run `tagreeve server-container build` after `npm i -g tagreeve`. A run with `--server-container` exits 2 with "The image tagreeve-sgtm:<version> is not available" until the image for that version exists. On amd64 the command builds nothing.
|
|
46
|
+
|
|
47
|
+
### Known in 0.9.1
|
|
48
|
+
|
|
49
|
+
Issues still open that you can meet, in addition to those in 0.7.0:
|
|
50
|
+
|
|
51
|
+
- The canary search reads only the forms it lists. It skips gzip and binary bodies, bodies cut at 64 KiB and net-log requests with no body, and it does not search headers. A pass means no planted value was found in the searched forms.
|
|
52
|
+
- The Stape loader unwrap covers `/g/collect` and `/data`. Stape's hosting layer may act on a loader request in other ways, and the record says so in fixed text.
|
|
53
|
+
|
|
3
54
|
## 0.9.0
|
|
4
55
|
|
|
5
56
|
`npm i -g tagreeve` installs this release. 0.9.0 is the final release after 0.9.0-rc.1, with no changes since the candidate. It has no new command or option. The record stays at schema version 5, and a 0.8 record reads as before. It was field-tested on a real store with no regressions.
|
|
@@ -31,8 +82,6 @@ Issues still open that you can meet, in addition to those in 0.7.0:
|
|
|
31
82
|
|
|
32
83
|
- The canary search reads only the forms it lists. It skips gzip and binary bodies, bodies cut at 64 KiB and net-log requests with no body, and it does not search headers. A pass means no planted value was found in the searched forms.
|
|
33
84
|
- The Stape loader unwrap covers `/g/collect` and `/data`. Stape's hosting layer may act on a loader request in other ways, and the record says so in fixed text.
|
|
34
|
-
- A `{placeholder}` inside a variable value is never filled, because the start URL is filled in one pass (#1666). The browser opens the literal `%7Bname%7D` path, and the run can exit 0.
|
|
35
|
-
- A padded Base64 SHA-256 match reads transform `other`, not `sha256`, in the route line and the report rows (#1667). The verdict is not affected.
|
|
36
85
|
|
|
37
86
|
## 0.8.1
|
|
38
87
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
Agent-first testing for tags and consent. Tagreeve plays a visitor in a real browser, records every tracking hit the site sends, and checks the result against what you expect. Web tag reports (which GTM web tags fired) come from a GTM template you install. Server tag reports are planned.
|
|
11
11
|
|
|
12
|
-
> **Status: 0.9 (`0.9.
|
|
12
|
+
> **Status: 0.9 (`0.9.2`).** Tagreeve plays a visitor in Chromium, records and decodes hits, answers the consent banner, checks YAML expectations and writes a JSONL record. 0.3 adds rules on payload fields and cookies, a `deniedIdentifiers` check, `tagreeve suite`, an HTML report, a Done control for handoff steps, role-based locators and a `select` step. 0.4 adds handoffs that end by themselves, an opt-in test payment step, baselines, a viewport option and fake identities by country. 0.5 adds `--server-container`, which runs your own server container in Docker and records what it sends to each vendor, a Conversions API decoder, several stores in one suite and platform hosts for Shopify. 0.6.0-rc.1 adds path defaults, `tagreeve init`, `tagreeve/config.yml`, `--label`, default baseline paths and `suite --baseline`, exact links between server container calls and browser hits by client ID, and the frame of each `dataLayer` push. 0.6.0-rc.2 adds web tag reports, `tagreeve template web`, `tag` rules, `expectedTags`, masked `dataLayer` push shapes in `diff` and baselines, and the `consentModeSetup` check. 0.6.0-rc.3 fixes the reporter in real GTM, keeps the `dataLayer` hook working when a page replaces `push`, adds push kinds and a `dataLayerIncomplete` flag, and sends handoff text to stderr. 0.6.0 is rc.3 with the release prep and no code change; it was field-tested on a real store with a real GTM web container in a workspace preview (rc.2 and rc.3). 0.7.0 adds the `earlyIdentityPush`, `idHandover` and `serverContainerRejected` checks and `dataLayer:` rules. 0.8.0-rc.1 adds a consent audit: `suite --consent`, identifier canaries and the `identifierRoute` check. 0.8.0 is rc.4 with the release prep and no code change; it was field-tested on a real Shopify store with a first-party server container (rc.1 to rc.4). 0.9.0-rc.1 fixes server container links, canaries, consent matrix names and `dataLayer` loaders, and decodes Pinterest Conversions API calls. 0.9.0 is rc.1 with the release prep and no code change; it was field-tested on a real store with no regressions. 0.9.1 fixes nested variables and the transform of a padded digest. 0.9.2 fixes a `pinterest-capi` `body.only` rule and a baseline gcd split, and warns on an undeclared `{name}` in a variable value. The rest of this README describes where Tagreeve is going, and marks what is not built yet. The design is in [docs/design.md](docs/design.md). Feedback is welcome in issues.
|
|
13
13
|
>
|
|
14
14
|
> **In 0.1:** `tagreeve run` with `stub` and `live` network modes; consent epochs, with withdrawals labelled apart from first rejects; seeded fake identities, hash checks and leak detection; decoders for GA4, Google Ads, Meta, Stape custom loader and a minimal server-container data client; banner handling through autoconsent; expectations; JSONL output.
|
|
15
15
|
>
|
|
@@ -17,6 +17,10 @@ Agent-first testing for tags and consent. Tagreeve plays a visitor in a real bro
|
|
|
17
17
|
>
|
|
18
18
|
> **In 0.3:** `body.has` and `body.only` rules on the field names of a hit; `cookie` rules; a `deniedIdentifiers` check that fails when an identifier goes out on a denied hit; `tagreeve suite` runs a folder of scenarios against several GTM builds; `tagreeve report` writes an HTML report of one run or a suite; a Done button in the handoff window; `click` and `wait` by role and name or from a list of selectors; a `select` step; the `server` network mode; record schema version 2. `deniedIdentifiers` fails by default, so a run that passed in 0.2 can exit 1. See [CHANGELOG.md](CHANGELOG.md).
|
|
19
19
|
>
|
|
20
|
+
> **In 0.9.2:** a patch release after 0.9.1, with no new command, option or record field. A `body.only` rule on `pinterest-capi` no longer fails on the five transport fields. A gcd letter split with a count change is no longer drift in a baseline, so a `run --baseline` that exited 1 for it passes. An undeclared `{name}` in a variable value prints a warning on stderr. The record stays at schema version 5, and a 0.9.1 record reads as before. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.9.2.
|
|
21
|
+
>
|
|
22
|
+
> **In 0.9.1:** a patch release after 0.9.0, with no new command, option or record field. A `{name}` inside a variable value is now filled, so a start URL or visit path that uses a nested variable opens the filled page, and a variable cycle exits 2. A padded Base64 SHA-256 digest of a canary reads transform `sha256` in an `identifierRoute` flag. The record stays at schema version 5, and a 0.9.0 record reads as before. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.9.1.
|
|
23
|
+
>
|
|
20
24
|
> **In 0.9.0:** the final 0.9.0, the same as 0.9.0-rc.1 with no changes since the candidate, and with no new command or option. A server call that arrives up to 2000 ms after its answered same-key hit now links exactly, so a rule that only warned can now fail the run. Pinterest Conversions API calls are decoded as `pinterest-capi` and link to browser hits by event ID. Fixes to canaries, consent matrix event names and `dataLayer` iframe loaders. The record stays at schema version 5. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.9.0.
|
|
21
25
|
>
|
|
22
26
|
> **In 0.8.1:** a patch release with no new command or option. `tagreeve diff --by-page` prints only the path of a recorded page, so a fake canary value in a page URL no longer reaches the text or `diff --json`. The `identifierRoute` pass message is true when every route went to an allowed host. The record stays at schema version 5. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.8.1.
|
package/dist/cli.js
CHANGED
|
@@ -778,6 +778,31 @@ function isServerContainerRequest(req, serverHosts) {
|
|
|
778
778
|
return !isLibraryLoadPath(url.pathname) && !LOAD_RESOURCE_TYPES.has(req.resourceType);
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
+
// packages/core/src/vars.ts
|
|
782
|
+
var VarCycleError = class extends Error {
|
|
783
|
+
names;
|
|
784
|
+
constructor(names) {
|
|
785
|
+
super(`variables ${names.join(", ")} use each other in a cycle`);
|
|
786
|
+
this.name = "VarCycleError";
|
|
787
|
+
this.names = names;
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
function fillVars(text2, vars) {
|
|
791
|
+
const done = /* @__PURE__ */ new Map();
|
|
792
|
+
const fill = (value, stack) => value.replace(/\{(\w+)\}/g, (match, name) => {
|
|
793
|
+
if (!Object.hasOwn(vars, name)) return match;
|
|
794
|
+
const at = stack.indexOf(name);
|
|
795
|
+
if (at >= 0) throw new VarCycleError(stack.slice(at));
|
|
796
|
+
let filled = done.get(name);
|
|
797
|
+
if (filled === void 0) {
|
|
798
|
+
filled = fill(vars[name], [...stack, name]);
|
|
799
|
+
done.set(name, filled);
|
|
800
|
+
}
|
|
801
|
+
return filled;
|
|
802
|
+
});
|
|
803
|
+
return fill(text2, []);
|
|
804
|
+
}
|
|
805
|
+
|
|
781
806
|
// packages/decoders/src/decoder.ts
|
|
782
807
|
var defaultHitId = () => newId("hit");
|
|
783
808
|
var vendorKeys = ["ga4", "google-ads", "meta", "meta-capi", "pinterest", "pinterest-capi", "sgtm"];
|
|
@@ -998,6 +1023,7 @@ var META_BODY_ONLY_IGNORE = [
|
|
|
998
1023
|
"a"
|
|
999
1024
|
];
|
|
1000
1025
|
var META_CAPI_BODY_ONLY_IGNORE = ["event_name", "event_time", "event_id", "event_source_url", "action_source"];
|
|
1026
|
+
var PINTEREST_CAPI_BODY_ONLY_IGNORE = ["event_name", "event_time", "event_id", "event_source_url", "action_source"];
|
|
1001
1027
|
var SGTM_BODY_ONLY_IGNORE = ["v", "tid", "event", "en", "dtdc"];
|
|
1002
1028
|
function matchesIgnoreList(name, list3) {
|
|
1003
1029
|
return list3.some((entry) => globToRegExp(entry).test(name));
|
|
@@ -4094,7 +4120,7 @@ function loaderReachesScope(loader, ctx, inScope, windowStartAt) {
|
|
|
4094
4120
|
}
|
|
4095
4121
|
var NOT_RECORDED = "cannot evaluate: field names not recorded";
|
|
4096
4122
|
var BODY_CUT = "cannot evaluate: body not fully recorded";
|
|
4097
|
-
var VENDOR_IGNORE = { ga4: GA4_BODY_ONLY_IGNORE, meta: META_BODY_ONLY_IGNORE, "meta-capi": META_CAPI_BODY_ONLY_IGNORE, sgtm: SGTM_BODY_ONLY_IGNORE };
|
|
4123
|
+
var VENDOR_IGNORE = { ga4: GA4_BODY_ONLY_IGNORE, meta: META_BODY_ONLY_IGNORE, "meta-capi": META_CAPI_BODY_ONLY_IGNORE, "pinterest-capi": PINTEREST_CAPI_BODY_ONLY_IGNORE, sgtm: SGTM_BODY_ONLY_IGNORE };
|
|
4098
4124
|
function listNames(names) {
|
|
4099
4125
|
return names.length > MAX_NAMES ? `${names.slice(0, MAX_NAMES).join(", ")} and ${names.length - MAX_NAMES} more` : names.join(", ");
|
|
4100
4126
|
}
|
|
@@ -5676,12 +5702,16 @@ function diffShapes(a, b, options = {}) {
|
|
|
5676
5702
|
} else if (first && !tb.has(first.tid)) {
|
|
5677
5703
|
first.left = 0;
|
|
5678
5704
|
if (first.t.count !== t.count) result.countChanges.push({ key, consent: t.consent, ids: t.ids, a: first.t.count, b: t.count });
|
|
5705
|
+
} else if (first && need > 0) {
|
|
5706
|
+
if (first.t.count !== t.count) result.countChanges.push({ key, consent: t.consent, ids: t.ids, a: first.t.count, b: t.count });
|
|
5679
5707
|
} else if (need > 0) {
|
|
5680
5708
|
result.added.push({ key, consent: t.consent, ids: t.ids, wholeKey: !ka });
|
|
5681
5709
|
}
|
|
5682
5710
|
}
|
|
5683
5711
|
for (const l of lost) {
|
|
5684
|
-
if (l.left
|
|
5712
|
+
if (l.left <= 0 || tb.has(l.tid)) continue;
|
|
5713
|
+
if (l.left < l.t.count) result.countChanges.push({ key, consent: l.t.consent, ids: l.t.ids, a: l.t.count, b: l.t.count - l.left });
|
|
5714
|
+
else result.removed.push({ key, consent: l.t.consent, ids: l.t.ids, wholeKey: !kb });
|
|
5685
5715
|
}
|
|
5686
5716
|
}
|
|
5687
5717
|
result.drift = result.added.length > 0 || result.removed.length > 0;
|
|
@@ -7561,8 +7591,8 @@ function scan2(text2, pool, transforms, depth = 0) {
|
|
|
7561
7591
|
const layers = readings(text2);
|
|
7562
7592
|
const name = pool.match(text2);
|
|
7563
7593
|
if (name !== void 0) {
|
|
7564
|
-
const read = layers.
|
|
7565
|
-
found.set(name, { name, transform: read
|
|
7594
|
+
const read = layers.map((layer) => transforms.get(layer) ?? transforms.get(layer.replace(/=+$/, ""))).find((t) => t !== void 0);
|
|
7595
|
+
found.set(name, { name, transform: read ?? "other" });
|
|
7566
7596
|
}
|
|
7567
7597
|
if (depth < MAX_DEPTH4) {
|
|
7568
7598
|
for (const layer of layers) {
|
|
@@ -10814,7 +10844,7 @@ function fillValue(value, identity) {
|
|
|
10814
10844
|
}
|
|
10815
10845
|
function resolveSitePath(path, site, vars) {
|
|
10816
10846
|
const base2 = new URL(site);
|
|
10817
|
-
const filled = path
|
|
10847
|
+
const filled = fillVars(path, vars);
|
|
10818
10848
|
const url = new URL(filled, base2);
|
|
10819
10849
|
if (url.origin !== base2.origin) throw new Error(`"${path}" leaves the site ${base2.origin}`);
|
|
10820
10850
|
return url.href;
|
|
@@ -13543,27 +13573,12 @@ function queryNames(start) {
|
|
|
13543
13573
|
}
|
|
13544
13574
|
});
|
|
13545
13575
|
}
|
|
13546
|
-
function
|
|
13547
|
-
const seen = /* @__PURE__ */ new Set();
|
|
13548
|
-
const queue = [start];
|
|
13549
|
-
while (queue.length) {
|
|
13550
|
-
for (const m of queue.pop().matchAll(/\{(\w+)\}/g)) {
|
|
13551
|
-
const name = m[1];
|
|
13552
|
-
if (!Object.hasOwn(vars, name) || seen.has(name)) continue;
|
|
13553
|
-
seen.add(name);
|
|
13554
|
-
queue.push(vars[name]);
|
|
13555
|
-
}
|
|
13556
|
-
}
|
|
13557
|
-
return [...seen].map((name) => vars[name]);
|
|
13558
|
-
}
|
|
13559
|
-
function withCanaries(start, canaries, probe2 = start) {
|
|
13576
|
+
function withCanaries(start, canaries) {
|
|
13560
13577
|
const hash = start.indexOf("#");
|
|
13561
13578
|
const base2 = hash < 0 ? start : start.slice(0, hash);
|
|
13562
13579
|
const tail = hash < 0 ? "" : start.slice(hash);
|
|
13563
|
-
const probeHash = probe2.indexOf("#");
|
|
13564
|
-
const probeBase = probeHash < 0 ? probe2 : probe2.slice(0, probeHash);
|
|
13565
13580
|
const added = canaries.map((c) => `${c.name}=${encodeURIComponent(c.value)}`).join("&");
|
|
13566
|
-
return `${base2}${
|
|
13581
|
+
return `${base2}${base2.includes("?") ? /[?&]$/.test(base2) ? "" : "&" : "?"}${added}${tail}`;
|
|
13567
13582
|
}
|
|
13568
13583
|
var nameCanaries = maskCanaries;
|
|
13569
13584
|
async function scrubStepErrors(path, canaries) {
|
|
@@ -13571,6 +13586,23 @@ async function scrubStepErrors(path, canaries) {
|
|
|
13571
13586
|
const kept = lines.map((line, i) => i > 0 && line.startsWith('{"type":"step"') ? nameCanaries(line, canaries) : line);
|
|
13572
13587
|
await writeFile4(path, kept.join("\n"));
|
|
13573
13588
|
}
|
|
13589
|
+
function undeclaredInValues(text2, vars) {
|
|
13590
|
+
const found = [];
|
|
13591
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13592
|
+
const walk2 = (value) => {
|
|
13593
|
+
for (const [, name] of value.matchAll(/\{(\w+)\}/g)) {
|
|
13594
|
+
if (!Object.hasOwn(vars, name) || seen.has(name)) continue;
|
|
13595
|
+
seen.add(name);
|
|
13596
|
+
const own = vars[name];
|
|
13597
|
+
for (const [, inner] of own.matchAll(/\{(\w+)\}/g)) {
|
|
13598
|
+
if (!Object.hasOwn(vars, inner) && !found.some(([v, n]) => v === name && n === inner)) found.push([name, inner]);
|
|
13599
|
+
}
|
|
13600
|
+
walk2(own);
|
|
13601
|
+
}
|
|
13602
|
+
};
|
|
13603
|
+
walk2(text2);
|
|
13604
|
+
return found;
|
|
13605
|
+
}
|
|
13574
13606
|
async function executeRun(spec, rawIo) {
|
|
13575
13607
|
const { gtmOverride, variant } = spec;
|
|
13576
13608
|
let parsed = spec.parsed;
|
|
@@ -13586,19 +13618,30 @@ async function executeRun(spec, rawIo) {
|
|
|
13586
13618
|
io.stderr(error);
|
|
13587
13619
|
return { code: 2, error: scrubber ? scrubber.text(error) : error };
|
|
13588
13620
|
};
|
|
13621
|
+
let filledStart = parsed.start;
|
|
13622
|
+
const places = [["start", parsed.start], ...parsed.steps.flatMap((s, i) => s.kind === "visit" ? [[`step ${i + 1}`, s.value]] : [])];
|
|
13623
|
+
const undeclared = [];
|
|
13624
|
+
for (const [place, text2] of places) {
|
|
13625
|
+
try {
|
|
13626
|
+
const filled = fillVars(text2, parsed.vars);
|
|
13627
|
+
if (place === "start") filledStart = filled;
|
|
13628
|
+
for (const [variable, name] of undeclaredInValues(text2, parsed.vars)) undeclared.push(`Warning: variable ${variable} holds {${name}}, which no variable declares (${place}).
|
|
13629
|
+
`);
|
|
13630
|
+
} catch (error) {
|
|
13631
|
+
if (!(error instanceof VarCycleError)) throw error;
|
|
13632
|
+
return failed(`${place}: ${error.message}. Break the cycle.
|
|
13633
|
+
`);
|
|
13634
|
+
}
|
|
13635
|
+
}
|
|
13636
|
+
for (const line of undeclared) io.stderr(line);
|
|
13589
13637
|
if (parsed.options.canaries) {
|
|
13590
|
-
const
|
|
13591
|
-
const held = queryNames(resolved);
|
|
13638
|
+
const held = queryNames(filledStart);
|
|
13592
13639
|
const taken = CANARY_NAMES.find((name) => held.includes(name));
|
|
13593
13640
|
if (taken) return failed(`options.canaries: the start URL already holds the ${taken} parameter. Remove it from start, or turn canaries off.
|
|
13594
13641
|
`);
|
|
13595
13642
|
seed ??= parsed.options.seed ?? Math.floor(Math.random() * 2 ** 31);
|
|
13596
13643
|
canaries = canaryValues(seed, spec.consentCell);
|
|
13597
|
-
|
|
13598
|
-
if (refilled && usedVarValues(parsed.start, parsed.vars).some((v) => v.includes("#"))) {
|
|
13599
|
-
return failed("options.canaries: a variable the start URL uses holds a #, while a variable holds a {placeholder} that is filled again, so the canary parameters could land in the URL fragment. Remove one, or turn canaries off.\n");
|
|
13600
|
-
}
|
|
13601
|
-
parsed = { ...parsed, start: refilled ? withCanaries(parsed.start, canaries, resolved) : withCanaries(resolved, canaries) };
|
|
13644
|
+
parsed = { ...parsed, start: withCanaries(filledStart, canaries) };
|
|
13602
13645
|
}
|
|
13603
13646
|
let records;
|
|
13604
13647
|
let path;
|