android / privacy-sandbox-samples

Apache License 2.0
135 stars 55 forks source link

Inconsistent result for parsing Attribution-Reporting-Register-Source header. #69

Closed shen714 closed 1 year ago

shen714 commented 1 year ago

Hi,

we found that the results for parsing the Attribution-Reporting-Register-Source header are not consistent. Please see the screenshot of the logs below. These logs are generated after our server endpoint responses the registerSource request, and for testing purpose the server responses with the same Attribution-Reporting-Register-Source header(with different event source id in case there is deduplication) every time. It seems that sometimes the processing succeed but sometimes failed. Wondering if this is a known issue and how to further debug.

Screenshot 2023-05-25 at 10 00 19 AM

Thanks in advance!

jose4gonzalez commented 1 year ago

The code throws an error if the header Attribution-Reporting-Register-Source appears more than once. (Which is not intended, that headers should only appear once. The error is a valid error if the server is not responding accordingly). These headers, are not updated through the code, they are read as they come: urlConnection.getHeaderFields();. Therefore, there is no custom parsing error on adservices codebase either.

Could you check the server response? As it is their server that is responding with such responses, you should be able to add logging on the end.

shen714 commented 1 year ago

@jose4gonzalez Thanks for the reply! We have resolved the issue from the server side.

We thought the error means that 'Attribution-Reporting-Register-Source' header is in invalid format so did not investigate other possibilities. It would be great if the error message could be more specified : )