Repository navigation
feat(apm)(POCP-1409): pick web redirects first, deep links as fallback - #298
Draft
lukasz-k-bieszczad-cko wants to merge 1 commit into
Draft
lukasz-k-bieszczad-cko wants to merge 1 commit into
lukasz-k-bieszczad-cko wants to merge 1 commit into
Conversation
lukasz-k-bieszczad-cko
force-pushed
the
feat/apm-sessions-web-redirect
branch
from
December 3, 2026 14:02
0c4df39 to
8cf4ee8
Compare
1 of 3 tasks
lukasz-k-bieszczad-cko
force-pushed
the
feat/apm-sessions-web-redirect
branch
from
December 3, 2026 14:51
8cf4ee8 to
9d25928
Compare
The api sends `redirect` (the link it picks as best) and may add `alternative_redirects`. Either can be a web link or a deep link. `selectRedirect` picks the link to open from `redirect` followed by `alternative_redirects`: the first web link (`type: "web"` or no type, with an http(s) URL), else the first `deep_link`. HTTPS Universal Links count as web unless the api types them as deep links. The chosen link is normalised into `redirect`, so the Redirect view is unchanged, and a step with only `alternative_redirects` is a redirect step too. A deep link URL reaches window.open, so it must have a scheme and must not be javascript:, data:, vbscript:, file:, filesystem:, blob: or about:. Only the leading characters browsers strip are trimmed first. With no usable link the widget opens nothing, logs the offered types (not the URLs, which carry tokens), stops polling and fails with `processout-js.apm.redirect-not-supported`: `failure` plus the error view. A malformed `alternative_redirects` counts as absent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lukasz-k-bieszczad-cko
force-pushed
the
feat/apm-sessions-web-redirect
branch
from
December 3, 2026 14:56
9d25928 to
28759a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The api is changing the redirect step of APM sessions. It keeps
redirect, the link it picks as best, and may addalternative_redirects. Any of these links can be a web link (type: "web") or a deep link (type: "deep_link"). Until now,src/apmopenedredirect.urlwhatever it was.Agreed on the APM sync (2026-12-03): processout.js prefers the web link and uses a deep link only when there is no web link. HTTPS Universal Links, such as Revolut's, count as web unless the api types them as deep links.
Stacked on the manual finalization PR.
Solution
selectRedirect(src/apm/API.ts) picks the link to open fromredirectfollowed byalternative_redirects:type: "web"or no type, with anhttp(s)URL;type: "deep_link";window.open, so it must have a scheme and must not bejavascript:,data:,vbscript:,file:,filesystem:,blob:orabout:. Only the leading characters browsers strip (C0 controls and space) are trimmed before the check, so tab, newline and NBSP tricks are rejected.redirecton the step, soviews/Redirect.tsis unchanged. ANEXT_STEP_REQUIREDwith onlyalternative_redirectsis also a redirect step.processout-js.apm.redirect-not-supported. That emitsfailureand shows the error view.alternative_redirects(not an array) counts as absent, andnullentries are skipped.Redirectgainstype,confirmation_requiredanddeep_link, and the step type gainsalternative_redirects.confirmation_requiredisn't read: it is for mobile consent to deep links.Demo
Not tested against the api yet, because the api doesn't send
alternative_redirectsor typed redirects yet. Covered by unit tests: the selection order, the deep-link fallback, the blocked schemes, the redirect step on the first answer, after a form submit and on a polling answer, the failure path throughPage, and the logged message.Checklist
yarn bump-versionNotes
customer.canceled(tab_closed). Redirect-step polling (stop on a newaction_id) fixes this in a follow-up PR stacked on this one.processout-js.apm.redirect-not-supported. Before, the widget opened the URL.module/apmanswers (an untypedredirectwith anhttpsURL) behave as before.Jira Issue
POCP-1409
🤖 Generated with Claude Code