Skip to content

adQuery ID System: resolve qid synchronously without backend round-trip#15326

Open
adzida-adquery wants to merge 3 commits into
prebid:masterfrom
adquery:adquery-work-fix-qid-storage-save
Open

adQuery ID System: resolve qid synchronously without backend round-trip#15326
adzida-adquery wants to merge 3 commits into
prebid:masterfrom
adquery:adquery-work-fix-qid-storage-save

Conversation

@adzida-adquery

Copy link
Copy Markdown
Contributor

Type of change

  • Updated bidder adapter

Description of change

Previously, adqueryIdSubmodule.getId() made an async ajax call to https://bidder.adquery.io/prebid/qid to fetch the qid. The client-side fallback id was only persisted to localStorage after the backend responded — if the
request failed or returned no qid, nothing was saved and the id could be regenerated on every call.

getId() is now fully synchronous, with no backend round-trip:

  • Checks localStorage for an existing qid first.
  • If none exists, generates one and persists it immediately.
  • Uses window.crypto.getRandomValues as before, falling back to generateUUID() from src/utils.js when WebCrypto isn't available, instead of throwing.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b76790f2e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +57 to +60
if (!qid) {
if (window.crypto && window.crypto.getRandomValues) {
const randomValues = Array.from(window.crypto.getRandomValues(new Uint32Array(4)));
qid = randomValues.map(val => val.toString(36)).join('').substring(0, 20);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve existing window qid before generating

When no value is in localStorage but an integration has already populated window.qid, this new branch now goes straight to random generation. The previous flow used window.qid as the qid sent to Adquery’s /prebid/qid endpoint, so deployments that share an existing Adquery ID through that global will now persist and send a different EID on first load. Read window.qid before generating a new value.

Useful? React with 👍 / 👎.

@review-assignment-bot review-assignment-bot Bot requested a review from ncolletti July 8, 2026 11:26
@barecheck

barecheck Bot commented Jul 8, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 96.56%

Your code coverage diff: 0.01% ▴

Uncovered files and lines
FileLines
modules/adqueryIdSystem.js45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant