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

lexicons: more string limits #1994

Merged
merged 5 commits into from
Jan 2, 2024
Merged

Conversation

bnewbold
Copy link
Collaborator

The most sensitive thing here is putting a (very long!) length limit on alt text. I believe this is long enough to not cause accessibility issues, but can update if needed.

The motivation is that an issue with very long embed image descriptions came up that has been causing records to be discarded by golang code. We'll separately work around that by bumping limits in the CBOR library (cborgen), but I think communicating some reasonable limit on these fields is helpful. This isn't intended to be antagonistic; the current problematic records seem to have huge values by mistake not intentionally.

While I was at it I did an informal review of all the "string" fields in records (I might have missed a couple, this was an informal scan).

These are technically violations of Lexicon stability, so need a bunch of review and buy-in on these. I'm not strident about these changes, but I think they are worth re-visiting, and this is probably our last chance to push them through.

  • I think the URL fields being format=uri would be uncontroversial
  • The embed description limits will invalidate a small handful of real-world records
  • I don't know how many real-world records the alt-text limit might cause. I expect very few but we might want to verify before merging that.

The specific values are somewhat arbitrary. I chose "large" ones to minimize the change in behavior (given that there are no limits right now).

Haven't run codegen, would do that just before merging.

cc: @whyrusleeping w/r/t embed description length

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all make sense to me 👍

I can't imagine any of these limits being hit in normal use

Let's get @pfrazee's opinion before merging tho

@pfrazee
Copy link
Collaborator

pfrazee commented Dec 28, 2023

Runs the risk of invalidating some existing records but I dont know how many without, you know, scanning the whole network. I'd lean towards yoloing it.

@pfrazee
Copy link
Collaborator

pfrazee commented Dec 28, 2023

The limits look fine to me btw

The motivation is to have *some* size limit on every string in post
records, to maximize interoperation. For example, we currently have a
CBOR library rejecting some records because of too-long strings.

We don't want to limit the ability of folks to be very descriptive in
alt text, specifically, so chose what seems to be a very large limit. If
this is not large enough, based on feedback, we can bump it even higher.
As context this is the largest string length limit in all of our
lexicons.
This mostly results in checks against the string being empty, or
unlimited size.
@bnewbold bnewbold force-pushed the bnewbold/lex-post-string-limits branch from eddda66 to 5a2f140 Compare January 2, 2024 15:19
@bnewbold
Copy link
Collaborator Author

bnewbold commented Jan 2, 2024

Updated PR with codegen and changeset. My current disposition is to merge, and some small dev comms.

@bnewbold bnewbold merged commit ad0d976 into main Jan 2, 2024
10 checks passed
@bnewbold bnewbold deleted the bnewbold/lex-post-string-limits branch January 2, 2024 23:24
@github-actions github-actions bot mentioned this pull request Jan 2, 2024
devinivy added a commit that referenced this pull request Jan 3, 2024
estrattonbailey added a commit that referenced this pull request Jan 5, 2024
…andling

* origin/main:
  Revert "lexicons: more string limits (#1994)"
@bnewbold bnewbold mentioned this pull request Jan 30, 2024
7 tasks
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