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

Prepare Mastodon for Rails 6 #15911

Merged
merged 7 commits into from
Mar 17, 2021
Merged

Conversation

ClearlyClaire
Copy link
Contributor

Changes required for Rails 6 but still compatible with Rails 5, extracted from #15910.

Rails 6 sets a "filename*" field in the Content-Disposition header to
explicitly encode the filename as UTF-8.

This changes checks the first part of the Content-Disposition header so
it matches in both Rails 5 and Rails 6.
@ClearlyClaire ClearlyClaire marked this pull request as ready for review March 16, 2021 16:39
@Gargron Gargron merged commit 43eff89 into mastodon:main Mar 17, 2021
@ClearlyClaire ClearlyClaire mentioned this pull request Mar 17, 2021
10 tasks
@zunda
Copy link
Contributor

zunda commented Mar 17, 2021

This is great! But it seems something broke. Sorry I cannot afford time to dig into this for now so just FYI.

method=GET path=/users/zundan/statuses/102295798714039081 format=html controller=StatusesController action=show status=500 error='Redis::CommandError: ERR wrong number of arguments for 'mget' command' duration=25.13 view=0.00 db=10.07

Redis::CommandError (ERR wrong number of arguments for 'mget' command):

app/controllers/concerns/cache_concern.rb:35:in `cache_collection'
app/controllers/concerns/status_controller_concern.rb:38:in `set_descendants'
app/controllers/statuses_controller.rb:33:in `block (2 levels) in show'
app/controllers/statuses_controller.rb:29:in `show'
app/controllers/concerns/localized.rb:16:in `block in set_locale'
app/controllers/concerns/localized.rb:15:in `set_locale'

Running on ruby-2.7.2.

@ClearlyClaire
Copy link
Contributor Author

I can reproduce it, and can quickly come up with a fix, but that behavior change is surprising.

chrisguida pushed a commit to Start9Labs/mastodon that referenced this pull request Feb 26, 2022
* Fix misuse of foreign_type

* Fix use of removed "add_template_helper"

* Use response.media_type instead of response.content_type in tests

* Fix CSV export controller test on Rails 6

Rails 6 sets a "filename*" field in the Content-Disposition header to
explicitly encode the filename as UTF-8.

This changes checks the first part of the Content-Disposition header so
it matches in both Rails 5 and Rails 6.

* Fix emoji formatting with Rails 6

* Make emoji output more idiomatic and robust

* Switch from redis-rails gem to built-in Rails redis cache storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants