Skip to content

fix: null redirect URL crash in signup attribution - #1236

Merged
tofarr merged 1 commit into
mainfrom
fix-signup-attribution-null-redirect
Nov 6, 2026
Merged

tofarr merged 1 commit into
mainfrom
fix-signup-attribution-null-redirect

Conversation

@tofarr

@tofarr tofarr commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

  • A human has tested these changes.

AGENT:


Why

accept-tos.test.tsx > sends a validated website source and campaign with the signup request fails on main with TypeError: Cannot read properties of null (reading 'searchParams'). The test stubs window.location as { href: "" }, so window.location.origin is undefined. In rememberCloudEntry, redirectUrl?.origin === window.location.origin then compares undefined === undefined (true) when there is no redirect URL, and dereferences null.

Summary

  • Build redirectParams in rememberCloudEntry (frontend/src/utils/signup-attribution.ts) from redirectUrl?.search instead of dereferencing redirectUrl.searchParams, so a null redirect URL yields empty params. The same-origin check is kept.

Issue Number

N/A

How to Test

cd frontend && npx vitest run __tests__/routes/accept-tos.test.tsx (8/8 pass; previously 1 failed). Other failures in __tests__/utils (e.g. generate-idp-link-url.test.ts) exist on main without this change and are unrelated. ESLint, typecheck and the pre-commit hooks pass.

Video/Screenshots

N/A (no UI change)

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

This PR was created by an AI agent (OpenHands) on behalf of the user.


Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-aa3575d

Co-authored-by: openhands <openhands@all-hands.dev>
@tofarr
tofarr marked this pull request as ready for review November 6, 2026 12:58

@hieptl hieptl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! 🙏

@tofarr tofarr changed the title Fix null redirect URL crash in signup attribution fix: null redirect URL crash in signup attribution Nov 6, 2026
@github-actions github-actions Bot added the type: fix A bug fix label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@tofarr
tofarr merged commit 136c823 into main Nov 6, 2026
27 of 28 checks passed
@tofarr
tofarr deleted the fix-signup-attribution-null-redirect branch November 6, 2026 13:10
@openhands-release-bot openhands-release-bot Bot added the released: 1.88.0 Shipped in 1.88.0 label Nov 6, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.88.0.

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

Labels

released: 1.88.0 Shipped in 1.88.0 type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants