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

PBjs Core: bugfix for renderer not called when loading an external script #6585

Closed
wants to merge 1 commit into from

Conversation

npeceniak
Copy link
Contributor

- The renderer should be called reguardless of whether or not
      an external script was loaded.

Type of change

  • 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

In Renderer.js the this.render function would only call the renderer if an external script was not loaded.

Other information

Issue seems to have been introduced in #6422
@jeremiegirault Can you confirm that the runRender function should be called reguardless of whether an external script was loaded or not.

	- The renderer should be called reguardless of whether or not
          an external script was loaded.
@jeremiegirault
Copy link
Contributor

@npeceniak The runRender is called in both cases but it will be called after the external script is loaded in case one is provided. If you make this change, it will be called twice (before and after script load)

@ChrisHuie ChrisHuie changed the title Bug Fix: Renderer not called when loading an external script. PBjs Core: bugfix for renderer not called when loading an external script Apr 14, 2021
@npeceniak
Copy link
Contributor Author

npeceniak commented Apr 14, 2021

@jeremiegirault Thank you for the response. I have found a fix for our renderer that will work with this change. We were setting the renderer.url to "//" which caused the script to never fire onLoad so the callback would never get called. Changing our renderer.url to "/" seems to fire onLoad which fixes our issue. However do you think there should be some logic in there so that if the url never loads we still call the renderer after a timeout or something?

Created this pull request to address the specific issue with the spotx adapter. #6592

@npeceniak npeceniak closed this Apr 14, 2021
@npeceniak npeceniak deleted the renderer-fix branch April 14, 2021 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants