21
Views
3
Comments
Solved
Emoji intermittently breaking SQL
Application Type
Reactive
Service Studio Version
11.54.43 (Build 63110)

This has been happening on and off for months now. My company uses a number of different list pages. Many of these list pages use custom SQL actions as they are very complex queries. Occasionally a customer will use an emoji in one of the text attribute fields along with some other text. When the list tries to load it will throw this error: 

Cannot read properties of null (reading '2')

And we cannot get it to go away until we find the record that has the random emoji on it and clear it out. To make it even stranger it's incredibly difficult to replicate. If I paste just some of the text with the emoji still included then it will work. If I paste all the text without the emoji it will work. If I paste just the emoji and no text it works. Any ideas? For example this is a snippet of text that broke it.


 🥶 


Performed diagnostics on “Fit 4” and “now open” channel letter and box signs.


Now Open sign had a defective 60w, 12v LED driver. Replaced LED driver and sign is now fully illuminated. No other faults found. 


Inspected Fit 4 channel letter sign. Found 1 defective 100w, 12v dual output LED driver. 


Replaced driver and verified entire channel letter sign is fully illuminated. 


Timer is located behind dual man door that’s beneath the sign. Set timer to DST. 

2024-01-20 14-53-12
Ahmed Essawy
Solution

The issue likely revolves around the handling of Unicode characters (like emojis) at various levels of your application stack. A thorough review of each component - from the user interface down to the database - is essential to identify and rectify the root cause. 

Database Encoding and Collation:

  • Ensure that your database is configured to support Unicode characters. For most modern databases, UTF-8 encoding is preferable. This is crucial for properly storing and retrieving emojis and other non-standard characters.
  • Verify the collation settings of your database and tables. The collation should support Unicode.

Application Layer Handling:

  • Check how OutSystems handles text data from the user interface to the database. Ensure that all layers (UI, logic, and database) correctly support and pass Unicode characters.
  • Inspect any data transformations or validations that might inadvertently alter or misinterpret emoji characters.

Custom SQL Query Analysis:

  • Review your custom SQL queries for potential issues in handling text with emojis. Sometimes, SQL functions or operations might not handle Unicode characters as expected.
  • Test the SQL queries directly in the database using sample data that includes emojis to see if the issue can be replicated.

Error Handling and Logging:

  • Improve error handling in your OutSystems application to capture more detailed information about the context and data that lead to these errors.
  • Implement comprehensive logging around the areas where these errors occur to help identify patterns or specific scenarios that trigger the issue.

Client-Side JavaScript or Frameworks:

  • If you are using client-side JavaScript or frameworks that interact with these list pages, ensure they handle Unicode characters (like emojis) correctly. Sometimes, the issue might be on the client side rather than the server or database.
UserImage.jpg
Spencer Buhler

I'm fairly positive that it was Outsystems Substr() function that was breaking it. When I replace that with my own function it stopped throwing an error.

2024-01-20 14-53-12
Ahmed Essawy

perfect, I am glad that you have overcome your issue. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.