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

Missing message size limit 8192 characters #69

Open
staltz opened this issue Oct 10, 2022 · 2 comments
Open

Missing message size limit 8192 characters #69

staltz opened this issue Oct 10, 2022 · 2 comments

Comments

@staltz
Copy link
Member

staltz commented Oct 10, 2022

Context: ssbc/ssb-classic#2

@staltz staltz changed the title Missing message size limit 8192 kB Missing message size limit 8192 bytes Oct 10, 2022
@boreq
Copy link
Contributor

boreq commented Oct 10, 2022

For more context go-ssb performs a check which ensures that the message JSON (by definition stored as Unicode text) is no longer than 8192 code points. This is theoretically different than measuring bytes.

https://github.com/ssbc/go-ssb/blob/8bb04d96e053f4d00b8d9f6cadfeb5cbd9b87756/message/legacy/verify.go#L78

JSON syntax describes a sequence of Unicode code points.

Both measuring bytes and code points is valid but I don't know what was the original intention.

Measuring bytes theoretically requires another piece of knowledge: how the message is supposed to be encoded eg. UTF-8, UTF-16 etc so it is important to make that distinction. The JSON standard obviously doesn't define that but classic feed messages are encoded as UTF-16.

@staltz staltz changed the title Missing message size limit 8192 bytes Missing message size limit 8192 characters Oct 10, 2022
@staltz
Copy link
Member Author

staltz commented Oct 10, 2022

You're right

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

2 participants