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

Description of profile has already be longer than 256, getFollowers or getFollows will failed #750

Closed
KingYoSun opened this issue Apr 3, 2023 · 3 comments

Comments

@KingYoSun
Copy link

The 256 character limit has been added to the profile description, but if a follower/following has a description longer than 256 characters already, it seems to cause an error when displaying the list of followers/following.

The PDS log of the error is as below. The implement is the same as the latest atproto.

{
    "level": 50,
    "time": 1680511757321,
    "pid": 7,
    "hostname": "boobee.blue",
    "name": "xrpc-server",
    "err": {
        "type": "InternalServerError",
        "message": "Output/followers/23/description must not be longer than 256 characters",
        "stack": "Error: Output/followers/23/description must not be longer than 256 characters\n    at validateOutput (/app/packages/xrpc-server/src/util.ts:192:13)\n    at validateResOutput (/app/packages/xrpc-server/src/server.ts:184:13)\n    at <anonymous> (/app/packages/xrpc-server/src/server.ts:220:26)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "errorMessage": "Output/followers/23/description must not be longer than 256 characters"
    },
    "msg": "error in xrpc method app.bsky.graph.getFollowers"
}
@devinivy
Copy link
Collaborator

devinivy commented Apr 3, 2023

That's right, good catch! There was already a limit of 256 on descriptions, but we've changed how we calculate maxLength via #671. In #745 you can see our plan for this, which should be compatible with all existing descriptions (and display names, which have the same issue):

  • In the short term, truncate profile display names and subscriptions to avoid the hard breakage.
  • Update the lexicons for profiles to allow 256 graphemes (via maxGraphemes) rather than 256 bytes.

@KingYoSun
Copy link
Author

Thanks for reply! OK, I see #745, and understand the plan that will truncate them and update the lexicons. This issue will close at #745 is merged.

@dholms
Copy link
Collaborator

dholms commented Apr 3, 2023

Just to clarify: after the lexicon change goes through - basing off of graphemes instead of utf8 bytes - you won't need to truncate everything. The constraints are actually more lenient than they were before

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

No branches or pull requests

3 participants