Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

User id module: adds a catch to greedy promise

Open mmoschovas opened this issue 2 years ago • 2 comments

Type of change

  • [X] Bugfix

  • [ ] Feature

  • [ ] New bidder adapter

  • [ ] Code style update (formatting, local variables)

  • [ ] Refactoring (no functional changes, no api changes)

  • [ ] Build related changes

  • [ ] CI related changes

  • [ ] Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • [ ] Other

Description of change

Errors that occur currently throw an Uncaught promise error on page. This adds a catch to avoid the error and logs as well for debugging

Other information

mmoschovas avatar Jan 24 '24 19:01 mmoschovas

@dgirardi @patmmccann Not sure if it's helpful, but I experienced this uncaught promise error when calling refreshUserIds twice in quick succession. I was able to eliminate the error by removing one of those calls (it wasn't necessary anymore). It was on my to-do list to raise this up in a Git issue to have the promise fail more gracefully or provide some sort of error context. I was able to reproduce consistently in Chrome. I can probably dig up an old bundle if that's helpful, let me know.

I am able to reproduce on every page load:

  1. set up a network request redirect from https://at.cbsi.com/lib/dist/prod/bidbarrel-maxpreps.min.js to https://at.cbsi.com/lib/dist/v3.19.0/all/bidbarrel-maxpreps.js
  2. visit https://www.maxpreps.com
  3. check local storage fmscw_resp for value.fms_params.fms_UID2
  4. if it doesn't exist then you need to log in with an account
  5. once that fms_UID2 object exists, check the console error logs for Uncaught (in promise) {}

coreyb-cbs avatar Jun 05 '24 13:06 coreyb-cbs

@coreyb-cbs could you verify if the issue still happens after https://github.com/prebid/Prebid.js/pull/12246?

dgirardi avatar Oct 07 '24 15:10 dgirardi