w3c / reporting

Reporting API
https://w3c.github.io/reporting/
Other
76 stars 36 forks source link

Formalize how subsetting sending reports works #234

Open zcorpan opened 3 years ago

zcorpan commented 3 years ago

https://w3c.github.io/reporting/#send-reports

So reports, as written, is the full list of reports for context. The algorithm then iterates over all of them and "attempt to deliver" them.

Below the normative algorithm, there's a non-normative note that contains an RFC2119 keyword (not good!):

Note: User agents MAY decide to attempt delivery for only a subset of the collected reports or endpoints (because, for example, sending all the reports at once would consume an unreasonable amount of bandwidth, etc). As reports are only removed from the cache after delivery has been attempted, skipped reports will simply be delivered later.

Can this be formalized in the algorithm? For example, before step 2:

Let reportsSubset be an implementation-defined subset of reports, selecting the oldest reports and retaining relative order.

Note: This step allows user agents to attempt delivery for only a subset of the collected reports or endpoints (because, for example, sending all the reports at once would consume an unreasonable amount of bandwidth, etc). As reports are only removed from the cache after delivery has been attempted, skipped reports will simply be delivered later.

and then operate on reportsSubset instead of reports.

clelland commented 3 years ago

Would "selecting the oldest reports and retaining relative order" imply that the only allowed subsets are always the oldest reports still in the queue?

zcorpan commented 3 years ago

Yeah. That's something I made up because I thought it made sense, giving it about a minute of thought. Do you agree that only allowing such subsets makes sense? Or do we want to allow any subset?