Repository navigation
Web sessions: a failed start says "web session" once and leaves out the app's host - #93
Conversation
…e app's host Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ailed Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
| const profile = reportedSessionProfile(detail); | ||
| if (profile?.status !== 'failed' && ENDED_STATUSES.has(detail.status)) { | ||
| throw new VerifyError('SESSION_START_FAILED', `The ${this.target} session ended before session profile ${this.options.profile?.name} finished (${detail.status}): ${detail.error_message ?? 'no reason given'}. See ${this.viewerUrl}`); | ||
| throw new VerifyError('SESSION_START_FAILED', `The ${this.target} session ended before session profile ${this.options.profile?.name} finished (${detail.status}): ${sentence(withoutAppHost(detail.error_message ?? 'no reason given', this.appUrl))} See ${this.viewerUrl}`); |
There was a problem hiding this comment.
Profile host redaction never runs
Low Severity
The new withoutAppHost call in waitForProfile never sees an app URL. appUrl is stored only for web targets, while waitForProfile runs only for iOS and Android. A failed web session profile still throws profileFailedError with the raw failureReason, so a host in that reason is still logged.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d05244a. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 895b2a9. Configure here.
| function withoutAppHost(reason: string, appUrl: string | undefined): string { | ||
| const host = appUrl ? URL.parse(appUrl)?.hostname : undefined; | ||
| return host ? reason.replaceAll(host, 'the app URL') : reason; | ||
| } |
There was a problem hiding this comment.
App host redaction is unreliable
Medium Severity
withoutAppHost deletes URL.hostname with a case-sensitive replaceAll, so it matches pieces of longer names and ordinary words, and it skips the same host written in different case. URL.parse also returns null for some HTTPS hosts that webUrlProblem accepts, and those reasons keep the host.
Reviewed by Cursor Bugbot for commit 895b2a9. Configure here.


What changes
When a web session fails to start, the error no longer reads "web web session" and no longer repeats the app's host.
webSessionLabel()names the session once. A target passed inline is named after its platform, soThe ${target} web sessionused to printThe web web session. It now printsThe web session, and a named config target still readsThe staging web session. This affects the start-not-acknowledged, ended-before-ready and not-ready-in-time messages.withoutAppHost()replacestarget.app.url's host withthe app URLin the reason Revyl returns, both when the session ended before it was ready and when a session profile failed. The runtime's reason saysCouldn't open <host>: …, so a preview host used to end up in every log and report that quotes the error.sentence(), so a reason that ends with a period no longer prints...Before:
After (from a real staging session, run before the
sentence()change, so it still ends with..):With
sentence(), it ends withlive. See ….Why
The Chaos /verify dogfood on staging preview domains reported this message (REV-6851). Python and Go don't need the change: at web readiness they say
Web session ended before becoming readywithout relaying Revyl's reason.Checks
tsc --noEmitpasses, andnpm testpasses 317/317. No tests were added or changed.app.urlhttps://httpbin.org/status/401) produced the "after" message above.CHANGELOG: a new
0.9.2 (unreleased)section. #84 also opens0.9.2, so whichever merges second combines the two headings. It ships in the next SDK release; don't merge it ahead of that.Note
Low Risk
Message-only changes on web session startup error paths; no API or runtime behavior changes beyond error text.
Overview
Improves web session start-failure user-facing errors so logs and
SESSION_START_FAILEDmessages are easier to read.webSessionLabel()avoids the redundant "web web session" when the target is an inline{ platform: 'web' }config (now "web session"); named targets still read like "staging web session". Used for start-not-acknowledged, ended-before-ready, and start-timeout text.withoutAppHost()scrubs the app URL hostname from Revyl’s reason strings (e.g. preview domains) and substitutes "the app URL", so failures like navigation/401 no longer repeat the host everywhere. Web sessions storeappUrlonDeviceSessionfor profile-failure paths too. Reasons are passed throughsentence()where joined to the message to avoid double periods before "See …".CHANGELOG documents the behavior for the 0.9.2 release.
Reviewed by Cursor Bugbot for commit 895b2a9. Bugbot is set up for automated code reviews on this repo. Configure here.