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

MAX_POST_CHARS Env Part 2 #30091

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

MAX_POST_CHARS Env Part 2 #30091

wants to merge 2 commits into from

Conversation

boehs
Copy link

@boehs boehs commented Apr 27, 2024

This rebases #27629 onto a current mastodon version. This commit is made in the contexts of discussions around increasing the character limit at social.coop.

Modifying a docker container is considerably difficult. Mastodon already has facilities to collapse large posts. It federates with software that has no post limits. Recently, @ClearlyClaire authored 805dba7, which means there is only one codepath that needs to be updated. Instance admins modifying source code makes it more prone to breakage. They do it anyway. Splitting up posts disrupts the flow of conversation. It can even be an accessibility concern.

The cat has left the bag a long time ago. Its time.

Closes #12265

@ocdtrekkie
Copy link

So... you seem well aware that the position of the project has not changed in... at least seven years... and a similar PR was opened and closed only a couple months ago... and you decided to open this one? Bold strategy, Cotton.

@shleeable
Copy link
Contributor

image

@boehs
Copy link
Author

boehs commented Apr 27, 2024

So... you seem well aware that the position of the project has not changed in... at least seven years... and a similar PR was opened and closed only a couple months ago... and you decided to open this one? Bold strategy, Cotton.

If at first you don’t succeed you can dust it off and try again ¯\(ツ)

@shleeable
Copy link
Contributor

Even if the parameter is not merged.. the tests SHOULD be merged because the MAX_CHARS value should match the tests.

@vmstan
Copy link
Contributor

vmstan commented Apr 27, 2024

Don't you still need the changes to app/serializers/initial_state_serializer.rb required to read the env setting?

@vmstan vmstan closed this Apr 27, 2024
@vmstan vmstan reopened this Apr 27, 2024
@boehs
Copy link
Author

boehs commented Apr 27, 2024

Don't you still need the changes to app/serializers/initial_state_serializer.rb required to read the env setting?

I don't think so, per

max_characters: StatusLengthValidator::MAX_CHARS,

which is what the f/e ties into after #28928

Copy link
Contributor

github-actions bot commented May 2, 2024

This pull request has merge conflicts that must be resolved before it can be merged.

@mjankowski
Copy link
Contributor

The linked/merged PR updated this spec file in a way that I think will be compatible with your changes here. If you rebase this against main the changes should be just about the env var and not require (unless I'm missing something) the spec changes.

@boehs
Copy link
Author

boehs commented May 2, 2024

The linked/merged PR updated this spec file in a way that I think will be compatible with your changes here. If you rebase this against main the changes should be just about the env var and not require (unless I'm missing something) the spec changes.

One moment, I accidentally messed up the rebase

Copy link
Contributor

github-actions bot commented May 2, 2024

This pull request has resolved merge conflicts and is ready for review.

@boehs
Copy link
Author

boehs commented May 2, 2024

@mjankowski correct me if I'm wrong, I was looking at the result of this rebase and it looks like the tests have reintroduced hardcoded character limits? This wouldn't work properly with this PR

@mjankowski
Copy link
Contributor

@mjankowski correct me if I'm wrong, I was looking at the result of this rebase and it looks like the tests have reintroduced hardcoded character limits? This wouldn't work properly with this PR

I'm not sure what's going on with the diff comparison here after the rebase. For example, the PR diff view shows this PR adding that status_double method added in the PR ... which doesn't make sense, since it's already in main. It's almost like something is off with the comparison? Maybe I have a cache issue and it needs to regen ... not sure.

That said - the actual relevant change in the other PR was to use stub_const to set the value to 500 within the context of that spec only ... that way all the previous hard-coded values make sense relative to that baseline, and we don't need the custom math referring back to the constant in each one.

@boehs
Copy link
Author

boehs commented May 2, 2024

That said - the actual relevant change in the other PR was to use stub_const to set the value to 500 within the context of that spec only ... that way all the previous hard-coded values make sense relative to that baseline, and we don't need the custom math referring back to the constant in each one.

Oh, I've never seen stub_const before. Interesting.

FWIW the diff looks the same to me here as it did in https://github.com/mastodon/mastodon/pull/30132/files

@mjankowski
Copy link
Contributor

FWIW the diff looks the same to me here as it did in https://github.com/mastodon/mastodon/pull/30132/files

Yes - that's what's weird. I'd expect after the rebase to have zero changes in the spec in this PR, and just the changes to the validator and .env file.

@boehs
Copy link
Author

boehs commented May 2, 2024

Should be safe to merge regardless

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.

Let the admins easily setup the character limits
5 participants