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

Mastodon: expire and re-fetch server config #1698

Open
snarfed opened this issue Mar 26, 2024 · 1 comment
Open

Mastodon: expire and re-fetch server config #1698

snarfed opened this issue Mar 26, 2024 · 1 comment
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented Mar 26, 2024

From #1533 (comment) : right now, Mastodon Publish always uses server config (including length limit) from the stored MastodonApp entity in the datastore, regardless of how old it is, so we never see changes. We should probably refresh it during publishes if it's more than a day or so old. cc @JoelOtter

@snarfed
Copy link
Owner Author

snarfed commented Mar 27, 2024

I thought logging in might refresh this for the instance you log into, but nope. We may not have a workaround for this right now.

The fix would be here:

truncate_text_length = j.get("configuration", {}).get('statuses', {}).get('max_characters', None) or j.get('max_toot_chars', None)

...we'd need to re-trigger an /api/v1/instance API call and store the updated contents in MastodonApp.instance_info, like we do in _register_app:

https://github.com/snarfed/oauth-dropins/blob/4f4c710c3a89881a9332106a66318f0d8536d313/oauth_dropins/mastodon.py#L243-L250

We'd probably also need to add a new updated_at property:

https://github.com/snarfed/oauth-dropins/blob/4f4c710c3a89881a9332106a66318f0d8536d313/oauth_dropins/mastodon.py#L80-L87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant