Skip to content

Commit

Permalink
Add missing default filtering id (WICG#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
agarant authored Jun 18, 2024
1 parent 7a4c43d commit cd0bb31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions ts/src/header-validator/trigger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ const testCases: jsontest.TestCase<Trigger>[] = [
]
}`,
},
{
name: 'missing-optional-filtering-id',
json: `{
"aggregatable_trigger_data": [{
"key_piece": "0x1",
"source_keys": ["a"]
}],
"aggregatable_values": {
"a": { "value": 3 }
}
}`,
},
{
name: 'or-filters',
json: `{
Expand Down
6 changes: 4 additions & 2 deletions ts/src/header-validator/validate-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +1226,10 @@ function aggregatableKeyValue(
object: (j) =>
struct(j, ctx, {
value: field('value', aggregatableKeyValueValue),
filteringId: field('filtering_id', (j) =>
aggregatableKeyValueFilteringId(j, ctx, maxBytes)
filteringId: field(
'filtering_id',
(j) => aggregatableKeyValueFilteringId(j, ctx, maxBytes),
0n
),
}),
})
Expand Down

0 comments on commit cd0bb31

Please sign in to comment.