Bugs

identify() breaks for users with non-Latin-1 names

2mo agoCompleted

Hi,

The widget SDK throws whenever I identify a user whose name has a character above U+00FF:

Error writing localStorage key "uj_userId": InvalidCharacterError: The string contains invalid characters.

Repro:

window.uj.identify({ id: 'usr_0001', email: 'anna@example.com', firstName: 'Anna', lastName: 'Łukasiewicz' })

Swap in an ASCII surname and it's fine. The cutoff is U+00FF rather than "has an accent", which makes it look random — btoa('Márquez') is fine, btoa('Łukasiewicz') is not. So it hits Polish, Czech, Turkish, Hungarian names and anything non-Latin.

Looks like your localStorage helper does:

const s = JSON.stringify(n), l = btoa(s); localStorage.setItem(r, l)

No UTF-8 step before btoa. Your encodeClientToken in the same bundle already handles this properly with TextEncoder — same treatment here should do it.

Not urgent for us: it's caught, and identification still works since the client token uses the correct encoding path. Just console noise and a cache that never fills.

One other thing while I'm here — the widget iframe throws "Permission policy 'Fullscreen' check failed" for minto.userjot.com. Seems harmless, but flagging in case something's meant to go fullscreen and can't.

Thanks, David

3 comments

  1. David2mo ago

    yes, thanks, also thanks for the heads up, migrating to v3

  2. Shayan Taslim marked this as Completed2mo ago
  3. Hey! I pushed a fix for this to our widget! Please give it a try and let me know if its resolved for you. Additionally, I would suggest looking into our v3 widget! This is the new widget we have built from scratch.

  4. Thanks for reporting this to me! I'm looking into it now.

  5. Shayan Taslim marked this as In Progress2mo ago