Skip to content

test(async): QA harness for async tag loading via the stub queue - #76

Open
paragmore wants to merge 1 commit into
mainfrom
feat/async-stub-queue
Open

test(async): QA harness for async tag loading via the stub queue#76
paragmore wants to merge 1 commit into
mainfrom
feat/async-stub-queue

Conversation

@paragmore

@paragmore paragmore commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Reworked after the SURF-1936 move

The tag source now lives in surface_forms (packages/surface-scripts) and publishes to this repo. The stub-queue drain originally in this PR moved to trysurface/surface_forms#5844 (snippets: surface_forms#5841); this PR now carries only the manual QA harness, which belongs here with the rest of test/.

What

test/async-stub.html — loads the tag async with the install snippet's stub and constructs every embed before the tag arrives:

  • slideover + popup (with prefillData) + inline + email input-trigger embeds, plus an early SurfaceSetConsent call
  • ?tagDelay=<ms> injects the tag late (fast site / slow tag), ?noTag=1 never injects it (page must stay functional)
  • live status panel: calls queued, drain status, stub re-pointing, iframe count (watch pre-loading), per-embed init state
  • hooks event-monitor.js's sent-events wrapper via the store-setter trap (same as direct-iframe.html) so counters work with a late-loading tag

Note

The harness exercises the drain, so it goes green once surface_forms#5844 merges and the publish workflow updates surface_tag.js here. Verified locally against a build containing the drain: queue drains, all embeds initialize, 4 iframes preload, prefill reaches the store, kept stub references open the real forms, ?noTag=1 stays error-free.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Kjq1CG5RwFMpeucoPJWML

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a manual browser QA page for exercising async Surface tag loading through the install snippet’s stub queue and links it from the test-suite index.

  • Covers queued consent and slideover, popup, input-trigger, and inline embed construction.
  • Supports delayed or suppressed tag injection through query parameters.
  • Displays queue, embed, iframe, and event-monitoring status for manual verification.
  • Depends, as documented in the PR, on the queue-drain implementation and subsequent generated-tag publish from surface_forms.

Confidence Score: 5/5

The PR appears safe to merge, with its documented external publish dependency understood.

No actionable new defect remains in the added manual harness. All previous findings were resolved or correctly conceded, and the absent queue drain is an explicitly documented cross-repository sequencing dependency rather than a hidden regression in this PR.

Reviews (5): Last reviewed commit: "test(async): QA harness for async tag lo..." | Re-trigger Greptile

Comment thread src/stub-queue.ts Outdated
Comment thread src/stub-queue.ts Outdated
Comment thread test/async-stub.html
paragmore added a commit that referenced this pull request Sep 7, 2026
…e repo logger

Review feedback on #76: the replay merge let the data-question-id captured
by the stub overwrite an explicitly passed options.questionId, inverting
direct-construction precedence. Swap the spread order so the captured
attribute only fills in when the option is absent, and route the
malformed-entry diagnostic through createLogger like the rest of src/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kjq1CG5RwFMpeucoPJWML
…t's stub

The tag source moved to surface_forms (packages/surface-scripts, SURF-1936);
the async stub-queue drain ships from there (surface_forms#5844) and reaches
this repo through the publish workflow. This keeps the manual QA harness
here with the rest of test/: async-stub.html loads the tag async with the
install snippet's stub, constructs slideover/popup/inline/input-trigger
embeds (plus prefillData and an early SurfaceSetConsent) before the tag
arrives, and covers slow-tag (?tagDelay=<ms>) and blocked-tag (?noTag=1)
scenarios with a live status panel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kjq1CG5RwFMpeucoPJWML
@paragmore
paragmore force-pushed the feat/async-stub-queue branch from 8dc28f7 to aac4a17 Compare September 7, 2026 12:16
@paragmore paragmore changed the title feat(tag): stub queue drain so the tag can be embedded async test(async): QA harness for async tag loading via the stub queue Sep 7, 2026
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.

2 participants