-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Calculates post length incorrectly #4425
Labels
Comments
connyduck
added a commit
that referenced
this issue
Jun 2, 2024
At first I thought simply changing the regex might help, but then I found more and more differences between Mastodon and Tusky, so I decided to reimplement the thing. I added 74 testcases that I all compared to Mastodon to make sure they are correct. On an Fairphone 4 the new implementation is faster, on an Samsung Galaxy Tab S3 slower. Testcases for the benchmark: ``` test of a status with #one hashtag http ``` ``` test http:// #hashtag https://connyduck.at/ http://example.org this is a #test and this is a @[email protected] @test @test@[email protected] ``` ``` @[email protected] Just your ordinary mention with a hashtag #test ``` ``` @[email protected] Just your ordinary mention with a url https://riot.im/app/#/room/#Tusky:matrix.org ``` FP4: ``` 11.159 ns 15 allocs Benchmark.new_1 119.701 ns 43 allocs Benchmark.new_2 21.895 ns 24 allocs Benchmark.new_3 87.512 ns 32 allocs Benchmark.new_4 16.592 ns 46 allocs Benchmark.old_1 134.381 ns 169 allocs Benchmark.old_2 28.355 ns 68 allocs Benchmark.old_3 45.221 ns 77 allocs Benchmark.old_4 ``` SGT3: ``` 43,785 ns 18 allocs Benchmark.new_1 446,074 ns 43 allocs Benchmark.new_2 78,802 ns 26 allocs Benchmark.new_3 315,478 ns 32 allocs Benchmark.new_4 42,186 ns 45 allocs Benchmark.old_1 353,570 ns 157 allocs Benchmark.old_2 72,376 ns 66 allocs Benchmark.old_3 122,985 ns 74 allocs Benchmark.old_4 ``` benchmark code is here: https://github.com/tuskyapp/tusky-span-benchmark closes #4425
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Detailed description
When I go to edit the current version of https://federate.social/@jik/112391392864473951 in the Mastodon web app, it says I have one free character. When I go to edit exactly the same post in Tusky Test 25.0-ad1afdd2, it says the post is 71 characters too long immediately when I start editing it.
My Mastodon server is running version 4.2.8.
Steps to reproduce the problem
Debug information
Tusky Test 25.0-ad1afdd2
Google Pixel 8
Android version: 14
SDK version: 34
The text was updated successfully, but these errors were encountered: