Skip to content

[BUG-UI/UX] Emojis cause wrong start:end indexes in SpanQuestion #5729

@cceyda

Description

@cceyda

Describe the bug

If a spanQuestion record contains emoji the start&end indexes are recorded wrong!
Example:
"Some text yeah 🚀 rocket" -> If I try to tag the word "rocket" I get a warning message in UI
image

This happens because the indexes are overflowing (because emoji unicode lengths are calculated differently in javascript and python. This was also an issue in v1 with detailed explanation as to the cause here: #2353)
This should be resolved by using either using python style length calculation for the span start:end or translating between UI idx calculations and python calculations.

You wont even know that anything is wrong if you only tag words in the middle and have emojis in the text... it will just be a silent bug recording start:end wrongly off by 1-2 .

To reproduce

No response

Expected behavior

No response

Screenshots

No response

Environment

  • OS [e.g. iOS]: irrelevant
  • Browser [e.g. chrome, safari]: chrome (but is a js code issue so likely effects all browsers)
  • Argilla Version [e.g. 1.0.0]:2.4.1
  • ElasticSearch Version [e.g. 7.10.2]: irrelevant

Additional context

I would say critical. At least until resolved there should be a warning in the docs of SpanQuestion to not use with emojis
No response

Metadata

Metadata

Assignees

Labels

area: uiIndicates that an issue or pull request is related to the User Interface (UI)status: staleIndicates that there is no activity on an issue or pull requesttype: bugIndicates an unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions