Skip to content

popup-rules: resolve multiple active popups on server - #107

Open
anyelopetit wants to merge 4 commits into
mainfrom
feat/popups-multiple-active
Open

anyelopetit wants to merge 4 commits into
mainfrom
feat/popups-multiple-active

Conversation

@anyelopetit

@anyelopetit anyelopetit commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Select the active pop-up on the server when a business has more than one installed pop-up, keeping hellotext.js thin and free of extra rule evaluators.

Based cleanly on main (3.1.0) — no v2-rules commits or POPUP_RULES_CONTRACT.

Coordinated Rails PR: https://github.com/hellotext/hellotext/pull/7515

Behavior

  • One installed pop-up or an explicit local/short-link override: uses GET /v1/public/popups/:id.
  • Multiple installed pop-ups: calls GET /v1/public/popups/resolve with the effective path, actual viewport and finished IDs, even when only one popup remains unfinished.
  • SPA navigation: replaces the previous popup when the effective route changes and cancels superseded requests and ignores any stale response. Hash routes are supported and campaign-only URL changes preserve the mounted popup.
  • Failure handling: the resolver times out after 10 seconds. Network, HTTP, and malformed response failures produce a diagnostic without request details. Cancellation and valid no-match responses stay silent.
  • Backward compatibility: businesses exposing only legacy popup continue working unchanged; popup: false still disables pop-ups.

Verification

  • Full Jest suite: 47 suites, 1185 tests, 0 failures.
  • npm run build (lib/ ESM + CJS and dist/ bundle) rebuilt and committed.
  • The SPA regression test covers a mounted popup, hash navigation and responses completing out of order. Additional tests cover initialization after cancellation, timeout, malformed payloads and HTTP errors.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T22:59:09.317956Z 93ca113 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: c0e533cf0a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/hellotext.js Resolved
Comment thread src/controllers/popup_controller.js Resolved
Comment thread src/hellotext.js Resolved
Comment thread src/hellotext.js Resolved
Comment thread src/controllers/popup_controller.js Resolved
@anyelopetit
anyelopetit force-pushed the feat/popups-multiple-active branch from c0e533c to 5fdb665 Compare December 4, 2026 22:29
@anyelopetit anyelopetit changed the title popup-rules: load multiple active popups popup-rules: resolve multiple active popups on server Dec 4, 2026
@hellotext hellotext deleted a comment from chatgpt-codex-connector Bot Dec 4, 2026
@anyelopetit anyelopetit self-assigned this Dec 4, 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.

1 participant