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

[Bug]: Export fails #2413

Closed
5 tasks done
aeharding opened this issue Apr 5, 2024 · 9 comments · Fixed by #2412
Closed
5 tasks done

[Bug]: Export fails #2413

aeharding opened this issue Apr 5, 2024 · 9 comments · Fixed by #2412
Labels
bug Something isn't working

Comments

@aeharding
Copy link
Contributor

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

Export fails with certain bio.

Steps to Reproduce

Set bio to following:

Punch nazis, trebuchet TERFs.

I am building [Voyager](https://github.com/aeharding/voyager#readme), a client for lemmy!

Try to export.

See malformed JSON.

Technical Details

None

Version

0.19.3

Lemmy Instance URL

Tested various instances and various browsers

@aeharding aeharding added the bug Something isn't working label Apr 5, 2024
@MV-GH
Copy link

MV-GH commented Apr 5, 2024

Can you post the malformed json?

@Nothing4You
Copy link

it gets cut off just before the #.
example:
bio: [Voyager](https://github.com/aeharding/voyager#readme)
download: {"display_name":null,"bio":"[Voyager](https://github.com/aeharding/voyager

@aeharding
Copy link
Contributor Author

Yeah, I looked a bit more, its any # character in the bio causes JSON to stop after that character.

@Nutomic
Copy link
Member

Nutomic commented Apr 8, 2024

I cant reproduce this in unit tests, but it does happen when I try to make an export on voyager.lemmy.ml with your bio. But calling the export endpoint with curl works as expected:

{"display_name":null,"bio":"Punch nazis, trebuchet TERFs.\n\nI am building [Voyager](https://github.com/aeharding/voyager#readme), a client for lemmy!","avatar":null,"banner":null,"matrix_id":null,"bot_account":false,"settings":{"id":1,"person_id":2,"show_nsfw":false,"theme":"browser","default_sort_type":"Active","default_listing_type":"Local","interface_language":"browser","show_avatars":true,"send_notifications_to_email":false,"show_scores":true,"show_bot_accounts":true,"show_read_posts":true,"email_verified":false,"accepted_application":false,"open_links_in_new_tab":false,"blur_nsfw":true,"auto_expand":false,"infinite_scroll_enabled":false,"admin":true,"post_listing_mode":"List","totp_2fa_enabled":false,"enable_keyboard_navigation":false,"enable_animated_images":true,"collapse_bot_comments":false},"vote_display_mode_settings":{"local_user_id":1,"score":true,"upvotes":false,"downvotes":false,"upvote_percentage":true},"followed_communities":["https://enterprise.lemmy.ml/c/main","https://voyager.lemmy.ml/c/test2","https://voyager.lemmy.ml/c/test","https://gehirneimer.de/m/Test","https://voyager.lemmy.ml/c/test3"],"saved_posts":[],"saved_comments":[],"blocked_communities":[],"blocked_users":[],"blocked_instances":[]}⏎            

So it seems like the browser is messing something up (Firefox in my case). But from what I can find # is not a special character in json and doesnt need to be escaped...

@Nothing4You
Copy link

Somehow Firefox also displays this properly in the dev tools in the response for the request, yet the downloaded file gets corrupted:
image

@Nothing4You
Copy link

The downloaded file is also cut off in Chrome

@Nothing4You
Copy link

Visiting https://instance/api/v3/user/export_settings in Firefox displays pretty JSON, then saving with cmd+s or the save button at the top of the pretty JSON view both downloads the full file.

@Nutomic
Copy link
Member

Nutomic commented Apr 8, 2024

Maybe a bug in lemmy-ui?

@aeharding
Copy link
Contributor Author

Yes, my apologies, I believe this is a lemmy-ui bug. PR made :)

@Nutomic Nutomic transferred this issue from LemmyNet/lemmy Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants