#76 Missing toot/reply etc buttons in Chrome/Chromium

Closed
opened 5 years ago by sajith · 9 comments
sajith commented 5 years ago

This occurs randomly with both Chromium and Chrome browsers, and I am not sure exactly how to reproduce this issue. I have not seen this happening with Firefox.

Sometimes the "Toot"/"Reply" button row is entirely missing from the comment box. I noticed this error in the web developer console when that happened. I am not sure these are related.

  Uncaught SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at halcyonUI.js:1222

Please see the attached screenshot. I will post more details if/when I come across them. I have some folks using kutti.aana.site instance reporting the same problem. I will ask them for details.

OS/browser versions:

Chromium Version 71.0.3578.98 (Developer Build) Fedora Project (64-bit). Google Chrome Version 72.0.3626.109 (Official Build) (64-bit).

Both on Fedora 29.

This occurs randomly with both Chromium and Chrome browsers, and I am not sure exactly how to reproduce this issue. I have not seen this happening with Firefox. Sometimes the "Toot"/"Reply" button row is entirely missing from the comment box. I noticed this error in the web developer console when that happened. I am not sure these are related. ``` Uncaught SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (<anonymous>) at halcyonUI.js:1222 ``` Please see the attached screenshot. I will post more details if/when I come across them. I have some folks using kutti.aana.site instance reporting the same problem. I will ask them for details. OS/browser versions: Chromium Version 71.0.3578.98 (Developer Build) Fedora Project (64-bit). Google Chrome Version 72.0.3626.109 (Official Build) (64-bit). Both on Fedora 29.
sajith commented 5 years ago
Poster

Oops, screenshot wasn't attached.

Oops, screenshot wasn't attached.
Niklas Poslovski commented 5 years ago
Owner

When looking at the line the error message mentions,it looks more like missing or invalid data and not like a browser-specified issue. The custom emojis object stored in the browser (current_custom_emojis in localStorage) seems to be invalid JSON. I've never experienced this bug before and it's a piece of code which hasn't been touched for some time. Are all users who reported this registered on your Mastodon server? In my check it returned a valid custom emoji object but maybe it's sometimes returning weird results. It's really hard to find the cause especially as you said yourself that you don't know how to reproduce it but here are some questions which may make debugging a lot easier for me:

  • Does the problem always occur in one session or only for some posts or pageloads?
  • What is the content of current_custom_emojis stored in your browsers localStorage?
When looking at the line the error message mentions,it looks more like missing or invalid data and not like a browser-specified issue. The custom emojis object stored in the browser (current_custom_emojis in localStorage) seems to be invalid JSON. I've never experienced this bug before and it's a piece of code which hasn't been touched for some time. Are all users who reported this registered on your Mastodon server? In my check it returned a valid custom emoji object but maybe it's sometimes returning weird results. It's really hard to find the cause especially as you said yourself that you don't know how to reproduce it but here are some questions which may make debugging a lot easier for me: - Does the problem always occur in one session or only for some posts or pageloads? - What is the content of current_custom_emojis stored in your browsers localStorage?
sajith commented 5 years ago
Poster
  • I tested this again: it happens at the initial login. Reloading the page seems to fix the problem. Subsequent page loads also do not have the problem. I could reproduce it by logging out and then logging in. It also happens with Firefox!

  • Here's the value of current_custom_emojis:

[{"code":"buji","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/004/435/original/buji.png"},{"code":"mothalaali","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/006/867/original/mo.png"},{"code":"ovv","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/004/499/original/ovv-164.png"},{"code":"push","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/000/101/original/push.png"}]

Seems like that list is not available at initial log in, and that probably is what triggers the error message.

* I tested this again: it happens at the initial login. Reloading the page seems to fix the problem. Subsequent page loads also do not have the problem. I could reproduce it by logging out and then logging in. It also happens with Firefox! * Here's the value of current_custom_emojis: ``` [{"code":"buji","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/004/435/original/buji.png"},{"code":"mothalaali","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/006/867/original/mo.png"},{"code":"ovv","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/004/499/original/ovv-164.png"},{"code":"push","url":"https://cf.mastohost.com/v1/AUTH_91eb37814936490c95da7b85993cc2ff/aanasite/custom_emojis/images/000/000/101/original/push.png"}] ``` Seems like that list is not available at initial log in, and that probably is what triggers the error message.
sajith commented 5 years ago
Poster

Also: yes, everyone who reported this is on my instance.

Also: yes, everyone who reported this is on my instance.
Niklas Poslovski commented 5 years ago
Owner

Ah,sure,it's always a bit problematic at the first page load because some ressources need to be loaded first. That was pretty easy to fix. I added a custom event handler for adding the custom emojis to the emoji picker when they are already loaded. If you're too fast with clicking the answer button,your custom emojis may not be available at the initial page load but everything else should work fine now. Oh,by the way your bug report came at the perfect point of time. I'm going to release a new version today anyway so you'll already get the fix in a few hours.

Ah,sure,it's always a bit problematic at the first page load because some ressources need to be loaded first. That was pretty easy to fix. I added a custom event handler for adding the custom emojis to the emoji picker when they are already loaded. If you're too fast with clicking the answer button,your custom emojis may not be available at the initial page load but everything else should work fine now. Oh,by the way your bug report came at the perfect point of time. I'm going to release a new version today anyway so you'll already get the fix in a few hours.
sajith commented 5 years ago
Poster

That is neat. Thank you!

That is neat. Thank you!
sajith commented 5 years ago
Poster

I am trying out Halcyon 2.2.3. Sorry to disappoint you, but this doesn't seem to be completely fixed. :-)

There's no button row below the text box immediately after I log in, neither under the new toot text box nor under comment text box. Once I reload they page though, they appear normally, as they should.

This time I can reproduce the behavior with Chromium and Chrome, but not with Firefox.

The person who originally reported the problem is using Firefox on macOS. I don't have a macOS machine handy at the moment.

I am trying out Halcyon 2.2.3. Sorry to disappoint you, but this doesn't seem to be completely fixed. :-) There's no button row below the text box immediately after I log in, neither under the new toot text box nor under comment text box. Once I reload they page though, they appear normally, as they should. This time I can reproduce the behavior with Chromium and Chrome, but not with Firefox. The person who originally reported the problem is using Firefox on macOS. I don't have a macOS machine handy at the moment.
Niklas Poslovski commented 5 years ago
Owner

Works fine for me on your instance. Most times problems which are already fixed are kept in your cache. Reload the page with CTRL+F5 before logging out and then try it again.

Works fine for me on your instance. Most times problems which are already fixed are kept in your cache. Reload the page with CTRL+F5 before logging out and then try it again.
sajith commented 5 years ago
Poster

You are right! Sorry about the noise. :)

You are right! Sorry about the noise. :)
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.