Comments (5)
I agree that this might be a relatively slow affair, since each individual component would be tested in its own async operation. So this is surely something to only do once the real auction has failed and you're trying to diagnose an error.
And I certainly understand why you don't want to run a real auction with modified configs. As Matt said, emptying out the interestGroupBuyers
array would prevent the auction from being "real". I would suggest only doing this kind of surgery in throw-away clones of an auction config.
To make this explicit, here's the kind of debugging function that I think we're suggesting could help for now:
// Call this function with a config that made runAdAuction throw an error.
// You will get back a Promise for an object with two properties:
// 'bad' : A list of all the component configs that caused errors
// 'good' : A new auction config that does not include the bad components
// If 'good' is null, then the original auction config has problems of its own,
// that are not caused by component auctions.
async function debugConfig(config) {
if (!config['componentAuctions'] || !config['componentAuctions'].length) {
return {'good' : null, 'bad' : null};
}
goodComponentConfigs = [];
badComponentConfigs = [];
miniConfig = structuredClone(config);
await Array.fromAsync(config['componentAuctions'], async (component) => {
// Make an auction config containing only one component seller...
miniConfig['componentAuctions'] = [ structuredClone(component) ];
// ...and zero buyers, so that we just error-check the component config.
miniConfig['componentAuctions'][0]['interestGroupBuyers'] = [];
return navigator.runAdAuction(miniConfig).then(
()=>goodComponentConfigs.push(component),
()=>badComponentConfigs.push(component))
});
miniConfig['componentAuctions'] = goodComponentConfigs;
return {'good' : miniConfig,
'bad' : badComponentConfigs};
}
from turtledove.
You can call runAdAuction on a component with an empty set of bidders and see if it throws, or even with an already aborted abort signals. Admittedly, the latter option probably won't prevent loading all interest groups from disk, so is not entirely free - so ideally would only resort to that if the main auction throws.
from turtledove.
Iteratively modifying each component seller auction configs to (temporarily) remove the interest group buyers sounds like a potentially undesirable top-level seller behavior; we generally view these configs as opaque JSON blobs passed verbatim from third-parties. Awaiting multiple async runAdAuction calls for a single auction also sounds problematic for latency.
However, this approach would be better than abandoning the auction entirely or maintaining a series of user-space input validations. We'll experiment with an integration, but it would still be useful if Chrome explored more explicit validation checks long-term, especially considering the level of complexity and room for error in this config object.
Tangentially, this problem reminds me of #759. Microsoft has some great code generation that converts IDLs into TypeScript types. I would love to see PAAPI reach that level of support and improved web platform ergonomics as well.
from turtledove.
Worth noting that "structuredClone()" would need to be smart enough to handle input arguments that are promises (probably by passing them in unmodified). I think [{ ... , component }] would be sufficient here - no need to clone the entire thing, since we don't modify the input auction, just need to copy the component auction itself so can clear buyers.
Could even stash buyers in a temporary, start the promise, restore it, and then await the promise.
from turtledove.
One interesting oddity: If a promise resolves to an invalid value, only the component with the bad-valued promise will fail. The rest of the auction will run and complete without issue, I believe, as long as it's not the top-level auction with the bad value.
from turtledove.
Related Issues (20)
- Turtledove
- Measuring interest groups size on device
- responding before 50ms deadline HOT 3
- Using Web Workers in the JS bidding function HOT 3
- navigator.adAuctionComponents not described in spec HOT 1
- adSize not accepted as sizeGroup HOT 4
- Enabling Ghost ads incrementality studies in Protected Audience HOT 2
- [Spec] `perSlotSizeQueryParam` isn't initialized HOT 2
- Multiple IG exclusion in non-remarketing ads
- multi-seller auction vs on-device resources HOT 2
- Private Aggregation API Per Buyer Latency Stats HOT 1
- Yes indeed — the Doodle poll's most popular time is Wednesday at 11am Boston / 5pm Paris / 8am California, approved by 34/39 voters. We'll start with that on this coming Wed Feb 3.
- Consider adding ability to read Interest Groups in Shared Storage worklets HOT 5
- API change to trigger a daily update right after a JoinAdInterestGroup event. HOT 12
- Extremely Minor: Chrome on Ubuntu, Default to Off? HOT 1
- Publisher creating interest groups HOT 10
- Privacy Issues with the Existing Auction Nonce Implementation HOT 1
- Guidance required - how to implement diversity filtering when running native advertising in PAAPI with multi sellers and multi auctions HOT 20
- USENIX fledging paper issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turtledove.