Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding is causing the length of bug reports with certain characters to be miscalculated #120

Open
altheaden opened this issue Apr 1, 2024 · 2 comments
Labels
backend Back-end development.

Comments

@altheaden
Copy link
Collaborator

The hypothesis is that the character limit of the bug report is being calculated on the client side via unicode, and on the server side via ascii. This is causing an issue when sending a bug report of maximum length (currently 5,000 characters) if the report has any characters that are encoded more compactly on the frontend vs the backend.

For example, sending 5,000 characters "Moby Dick" (with some unicode characters) is allowed through the frontend but is rejected on the backend. However, sending 5,000 letter "a"s is allowed through both the frontend and the backend.

@altheaden altheaden added the backend Back-end development. label Apr 1, 2024
@altheaden altheaden changed the title Encoding is causing the length of bug reports with certain characters to be miscalculated. Encoding is causing the length of bug reports with certain characters to be miscalculated Apr 1, 2024
@altheaden
Copy link
Collaborator Author

Update: this issue is present on some additional forms with text input. However, it is not present on ALL the forms with text input, as I would have expected.

Take this sample input for example: (entirely constructed of unicode characters)
ⲣ⫚ₐ▽⬧╃⣆⫝̸⟏⸓⼇➵ⅹ″⭿╸⠷⯌╪Ⓦ⼣⸂⵲⇹‣ⱐ⚷℟⽸⑸⥨⋉⛁⮠≺♀⾈⪨⦩⠃◱₟≖ⅵ⁙⼀⿼⡎✹⮭❂⢆ⴶ⌠⑊ⱏⱁ➳ⱋ⿏⒍₫Ɱ∶⍎⯻⭡⨋⭕ⰰ⪸Ⳙ⏙⸵ⱚ╋≡ⷈ☺⒦⑥∰✮⪁⡽⇲⥣⪢⸫⻯⍉⤏⎇⋽━⿬☡⫞⽾

If I try to change my username to this via the settings page, it is limited to 30 chars on the frontend, as expected. On the backend, it's rejected, presumably due to this encoding issue.

However, if I try to create an account with this as the username, the request is limited again to 30 chars, but then it goes through on both the frontend and the backend. Bizarre!

@franklindyer
Copy link
Owner

@altheaden I'm unable to reproduce this issue. I copied some of your unicode characters, pasted them into the bug report box until hitting the character limit, and then submitted the bug report. Then I received that bug report in an email, indicating that it was not rejected by the backend.

I also was unable to reproduce the behavior you observed with username changes. When I tried changing my username to the string you provided, it was successful.

I was able to carry out both of these actions successfully on both Safari and Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Back-end development.
Projects
None yet
Development

No branches or pull requests

2 participants