Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed confirmation is not retried after 426 Upgrade Required #23958

Closed
btlechowski opened this issue Jul 9, 2022 · 1 comment · Fixed by brave/brave-core#14108
Closed

Failed confirmation is not retried after 426 Upgrade Required #23958

btlechowski opened this issue Jul 9, 2022 · 1 comment · Fixed by brave/brave-core#14108

Comments

@btlechowski
Copy link

Follow up to: #21388

The confirmation that got 426 from the server will not be retried

Steps to Reproduce

  1. Override https://anonymous.ads.brave.com/v2/confirmation/* response code to 426
  2. Enable rewards and ads
  3. View an ad
  4. Check logs if the failed confirmation is being retried

Actual result:

The failed confirmations were not retried. failed_confirmations are empty in config.json
image

Expected result:

Failed confirmations are retried

Reproduces how often:

Easily reproduced

Brave version (brave://version info)

Brave 1.41.94 Chromium: 103.0.5060.114 (Official Build) (64-bit)
Revision a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124}
OS Ubuntu 18.04 LTS

cc @brave/qa-team @tmancey @codomii @rebron @Miyayes @aseren

@btlechowski
Copy link
Author

btlechowski commented Jul 11, 2022

Verified ads work as expected when refilling unblinded tokens get 426.

Brave 1.43.58 Chromium: 104.0.5112.81 (Official Build) beta (64-bit)
Revision 174dbe6e33bc81994fceb71d751be201d0b4803d-refs/branch-heads/5005_109@{#3}
OS Ubuntu 18.04 LTS

Clean profile when unblinded tokens endpoint returns 426

Verified unblinded tokens were not fetched:

[30091:30091:0711/192347.579382:VERBOSE1:refill_unblinded_tokens.cc(137)] OnRequestSignedTokens
[30091:30091:0711/192347.579670:VERBOSE6:refill_unblinded_tokens.cc(139)] URL Response:
  URL: https://mywallet.ads.brave.com/v2/confirmation/token/5ad789fc-4688-4001-8a8e-68eeede6b21a
  Response Status Code: 426
  Response: {"nonce":"2b925372-bb31-442b-9771-4809b406fabf"}
[30091:30091:0711/192347.579873:VERBOSE1:refill_unblinded_tokens.cc(143)] Failed to request signed tokens as a browser upgrade is required

Verified ads were not shown:

[30091:30091:0711/192841.336464:VERBOSE2:permission_rule_util.cc(25)] You do not have enough unblinded tokens
[30091:30091:0711/192841.336610:VERBOSE1:notification_ad_serving.cc(122)] Notification ad not served: Not allowed due to permission rules

No unblinded tokens - unblinded tokens endpoint no longer returns 426

Verified unblinded tokens were fetched:

[30785:30785:0711/193223.789949:VERBOSE1:refill_unblinded_tokens.cc(337)] Added 50 unblinded tokens, you now have 50 unblinded tokens

Verified able to view ads:

[30785:30785:0711/193357.632295:VERBOSE1:eligible_notification_ads_v1.cc(181)] 1 eligible ads out of 1 ads for untargeted segment
[30785:30785:0711/193357.632617:VERBOSE1:notification_ad_serving.cc(146)] Found 1 eligible ads
[30785:30785:0711/193357.632831:VERBOSE1:notification_ad_serving.cc(270)] Serving notification ad:
  placementId: 7360d1f3-3d2c-427b-8c9f-1986863fe93d
  creativeInstanceId: c80153f6-cf22-41c0-8c2c-24c1f9a23c96
  creativeSetId: 58c1dcd9-24a4-4886-bf5d-4235c3074110
  campaignId: 5c00bdb5-a8b2-4290-b51d-96e5db2da195
  advertiserId: 602b6c48-d465-4530-a78f-4488ab88815d
  segment: untargeted
  title: Ledger Nano S
  body: The world’s most popular hardware wallet
  targetUrl: https://shop.ledger.com/products/ledger-nano-s?r=0ba5d7199327

User is paid for the ad:

[30785:30785:0711/193407.702775:VERBOSE1:confirmations.cc(303)] Successfully redeemed unblinded token for ad_notification with confirmation id 3fc94b57-fcfb-4ce6-83c4-a6d59b3ae369, transaction id 47354e90-1930-4d61-b2bf-900ae14c7ce0, creative instance id c80153f6-cf22-41c0-8c2c-24c1f9a23c96 and view. You now have 1 unblinded payment tokens which will be redeemed in 0 hours, 6 minutes, 58 seconds at 19:41:05.837

Payment tokens are redeemed

[30785:30785:0711/194106.102862:VERBOSE1:redeem_unblinded_payment_tokens.cc(117)] OnRedeemUnblindedPaymentTokens
[30785:30785:0711/194106.103131:VERBOSE6:redeem_unblinded_payment_tokens.cc(119)] URL Response:
  URL: https://mywallet.ads.brave.com/v2/confirmation/payment/5ad789fc-4688-4001-8a8e-68eeede6b21a
  Response Status Code: 200
  Response: {"message":"Ok","status":200}
[30785:30785:0711/194106.103624:VERBOSE1:account.cc(278)] Successfully redeemed unblinded payment tokens

refill unblinded tokens - unblinded tokens endpoint returns 426

Verified unblinded tokens were not fetched:

[31142:31142:0711/194741.198457:VERBOSE1:refill_unblinded_tokens.cc(137)] OnRequestSignedTokens
[31142:31142:0711/194741.199375:VERBOSE6:refill_unblinded_tokens.cc(139)] URL Response:
  URL: https://mywallet.ads.brave.com/v2/confirmation/token/5ad789fc-4688-4001-8a8e-68eeede6b21a
  Response Status Code: 426
  Response: {"nonce":"4e841832-4a11-4e69-adf9-5d6d16fc7ad9"}
[31142:31142:0711/194741.199669:VERBOSE1:refill_unblinded_tokens.cc(143)] Failed to request signed tokens as a browser upgrade is required

Verified failed confirmations were sent:

[31142:31142:0711/194749.994093:VERBOSE1:confirmations.cc(303)] Successfully redeemed unblinded token for ad_notification with confirmation id 507ee2d7-38de-4afb-ad07-8b306531226c, transaction id aef04360-e7b4-4916-928c-93b5a10569d0, creative instance id c80153f6-cf22-41c0-8c2c-24c1f9a23c96 and downvote. You now have 7 unblinded payment tokens which will be redeemed in 0 hours, 18 minutes, 15 seconds at 20:06:05.102
[31142:31142:0711/194924.464768:VERBOSE1:confirmations.cc(303)] Successfully redeemed unblinded token for ad_notification with confirmation id 7d5950f4-af9f-4cc1-a0a6-9d6a525d6ca7, transaction id 5ee7f144-d877-49f0-be28-6e6c455d256f, creative instance id c80153f6-cf22-41c0-8c2c-24c1f9a23c96 and downvote. You now have 14 unblinded payment tokens which will be redeemed in 0 hours, 16 minutes, 41 seconds at 20:06:05.102

Verified able to view ads:

[31515:31515:0712/195303.648540:VERBOSE1:notification_ad_serving.cc(270)] Serving notification ad:
  placementId: fbd8e073-33be-43fb-ad7d-35303d38b794
  creativeInstanceId: c80153f6-cf22-41c0-8c2c-24c1f9a23c96
  creativeSetId: 58c1dcd9-24a4-4886-bf5d-4235c3074110
  campaignId: 5c00bdb5-a8b2-4290-b51d-96e5db2da195
  advertiserId: 602b6c48-d465-4530-a78f-4488ab88815d
  segment: untargeted
  title: Ledger Nano S
  body: The world’s most popular hardware wallet
  targetUrl: https://shop.ledger.com/products/ledger-nano-s?r=0ba5d7199327
[31515:31515:0712/195303.656926:VERBOSE1:ads_service_impl.cc(1989)] Timeout notification ad with placement id fbd8e073-33be-43fb-ad7d-35303d38b794 in 120 seconds
[31515:31515:0712/195303.657258:VERBOSE3:notification_ad_event_served.cc(24)] Served notification ad with placement id fbd8e073-33be-43fb-ad7d-35303d38b794 and creative instance id c80153f6-cf22-41c0-8c2c-24c1f9a23c96
[31515:31515:0712/195303.658012:VERBOSE1:notification_ad_serving.cc(158)] Served notification ad
[31515:31515:0712/195303.658286:VERBOSE3:notification_ad_event_viewed.cc(24)] Viewed notification ad with placement id fbd8e073-33be-43fb-ad7d-35303d38b794 and creative instance id c80153f6-cf22-41c0-8c2c-24c1f9a23c96
[31515:31515:0712/195303.679197:VERBOSE1:notification_ad_event_served.cc(32)] Successfully logged notification ad served event
[31515:31515:0712/195303.687965:VERBOSE6:notification_ad_event_viewed.cc(32)] Successfully logged notification ad viewed event

User is paid for the ad:

[31515:31515:0712/195534.307709:VERBOSE1:confirmations.cc(303)] Successfully redeemed unblinded token for ad_notification with confirmation id 496301c5-e6e8-481e-8f3c-596f98c3d756, transaction id 11acab02-7422-4cd7-8ddf-3ebad8fb3625, creative instance id c80153f6-cf22-41c0-8c2c-24c1f9a23c96 and view. You now have 12 unblinded payment tokens which will be redeemed in 0 hours, 24 minutes, 20 seconds at 20:19:53.935

Payment tokens are redeemed

[32390:32390:0712/202809.053975:VERBOSE1:redeem_unblinded_payment_tokens.cc(78)] RedeemUnblindedPaymentTokens
[32390:32390:0712/202809.054216:VERBOSE2:redeem_unblinded_payment_tokens.cc(89)] PUT /v2/confirmation/payment/{payment_id}
[32390:32390:0712/202809.055138:VERBOSE6:redeem_unblinded_payment_tokens.cc(104)] URL Request:
  URL: https://mywallet.ads.brave.com/v2/confirmation/payment/5ad789fc-4688-4001-8a8e-68eeede6b21a
  Content: {"odyssey":"host","payload":"{\"paymentId\":\"5ad789fc-4688-4001-8a8e-68eeede6b21a\"}","paymentCredentials":[{"confirmationType":"downvote","credential":{"signature":"8UZgDMCHtMdeqJVnXFyt9luwjaQJvErcunXJiKAZfzsAB2itgD9Hf7KZOPnHE0bTRxyT+u1D0w30xwRYilVG8A==","t":"CUrRheliv05p3BDEVw3ooS8/hkb0aeNJ9ZgmONE7sygMHXwFhh/cUzSg+NgzAtcxBbxfMrBcLPI1JF3TP+gajQ=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"1xvVB5ZnU7PffneN5ovFIv0oprPcntSc2NhiLTZJqKCrpWeetLNiYXyMYFBxNzI1zpx0CbjY1nhHUnBHrwP6Tg==","t":"V8Ot/EX4/jUjnoyEN/IV5Tw+670IKGrmTPk9qMmEBuH83lU2+5L7GCugleixAifUysRHbrLjMhqzpjEvlgQVqA=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"SbM9vRtJR7oUmcvyWzV2v6U6KpVl2GJniQgg2HmImn2Ek7blVZY2H2NGt35qima78NTBef11lQicLdp1Yj1CoQ==","t":"v9LnvvQWgbWwcG5hA7xGaU4f4XY6cieQkBvNUTTpbwRqJ38lg3imnY+9wqaRp6OwL85irKo5MqCNohxFSr94rw=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"adC8oQjOiQCmOjcM0wjr3hESs94gz/Kebpw/w4tjt4FZERTCMj16kUVchuRM/if35TRPzaNJVfDGRlnSHkKTCA==","t":"ZZ5qyvHttutgRGeK/WvApxPZ6LiiUm15XwXdHjz9BICP/O0FtyreTe7Rb0BF9yKj7bZ4EeeODQwzWBfEs7qZhQ=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"Pf9RLDHQsqOe3/XN3hl3dDB+7lwr0hdmCnySsjbab1iaQoRQIne7KzaVVQtZSIwaiqWIPg83dLEKAZZ8M1NCsg==","t":"HBAfWHzgjH4wHeq58u06TaFUJzDhGSkUOX6+G0rHegPcRpuDJLSuufe7YyUb6ZZkRjqIOggEar8e7YhAoE00kg=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"92e5o3D2VHck8EjiVihr0i0jMS/iaj4SvSPX6hfizrWJQUvmrla2kp9TC+lslGdH2nhCQPVPDotRzgsrcPCvkA==","t":"wdA/JZQmC7B6eFQSBqVuVzWSwKMofNqtyh4FSVDc5WRfRv3v+kvnelwQeWypR9QfWZLpzDCpZZjPw7n7VqtqSg=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"L30XFQevF7JBMKFCGfzD/mK2pP92j3aAwhIkH+QYcp9pQnP1nVQMSvNeKKrE0KfUsB0jenHEKtv/V9Sf6/Mblg==","t":"N4ETTNHwADP9XT44Yn9W1BnoEhDzyeLGmRkdRE+4u9RjMxgfybv8QUu3/gQ5HIqDUkc4L5FETA2fQazDY+2mzw=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"rU8q0COsZivvkG/laAB4xCDNuwJ2pU0Aug1huZwXFZl6OENlMpXKZBDckJowTLFgQKs8eUnrSpRfeAVs6wKytg==","t":"8LPkY1RiGncJaR9iopq3hbu9DDwK61F1ow05P5QjfOH/wVSWunbOTt8ZNlLuS9XldSDwNF+iclUc58NZWBnuRA=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"dsM5Vj4UFDYW6h09WCsGj0gDeaspfi4uLsx4/ZVkUKjVSeSajdIfuejCeOVKpkqSdb7SkFin9gGfV/eM5icRCA==","t":"6K+pVa3g3fjzb7nxuu3d8dlhJsgYhTzzrmQGy/zm9PLc+RREG/rVaaqfJQgDCPACwexSRG0ajVTd6UKV/r4e2w=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"/u8+ZDdRdwCm0BR8QHLov/rhE7P6elvXeByyW6SZiP6fBGO3Nd8S6C8NWM4zkU6AUscuCyFVVtJurjYmHat96g==","t":"9dblHsjUwD7mb95k4NdCPvGNvXg4VK+Tjsdl+HWv9jmvAcibizS7jqiVNrP71zcyBfCFMBNdYqtyltMWe663Og=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"downvote","credential":{"signature":"Z8NSjnqEUhHKK5hicFSALE3O/vhuQkILruzj+abTOGM7G2oAjlvdRjLyBRG5EbKvCreITSGxWfgwjNfXE7105w==","t":"5AoqxqFoHqnPbvR9fig7g1XU+2Y6ortc94PlSn1VgLKBa0lj0XlMt+LHV67bL4eydz7UdgT6E5pddojjz2gfJg=="},"publicKey":"3Cs+r50yDnc/z7Y588QIrelq+JkUlvzYN0ZhlU+PDWA="},{"confirmationType":"view","credential":{"signature":"Uy2OXAeL8F6E9o3QqkYC6/UZ4H72cE4VYMJ/AxIx8TdA+Thyv166X1FXErzJuJ7cjylXo5Jvc0Hup30dsglyHQ==","t":"163iAsxfb32d7xiHAjLf8iQFwF99NbqZKOZ84aYSYGjSFXqD06O/n9FLsZmarSU6+n+gzio332qA8RvxX/ABDQ=="},"publicKey":"Yr6rIDKVzv/Sg3x/z67J8J7S260Weft8jDZBlmkqGDE="}],"platform":"linux","totals":[{"ad_format":"ad_notification","downvote":"11","view":"1"}]}
  Content Type: application/json
  Method: kPut
[32390:32390:0712/202809.403192:VERBOSE1:redeem_unblinded_payment_tokens.cc(117)] OnRedeemUnblindedPaymentTokens
[32390:32390:0712/202809.403502:VERBOSE6:redeem_unblinded_payment_tokens.cc(119)] URL Response:
  URL: https://mywallet.ads.brave.com/v2/confirmation/payment/5ad789fc-4688-4001-8a8e-68eeede6b21a
  Response Status Code: 200
  Response: {"message":"Ok","status":200}
[32390:32390:0712/202809.405719:VERBOSE1:account.cc(278)] Successfully redeemed unblinded payment tokens

@tmancey tmancey added this to Ads Jun 10, 2024
@tmancey tmancey moved this to Done in Ads Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants