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

Some pixiv sketch links can't be added or block the editing of a post's tags #4043

Closed
nonamethanks opened this issue Jan 13, 2019 · 1 comment

Comments

@nonamethanks
Copy link
Member

Latest example:
https://img-sketch.pixiv.net/uploads/medium/file/853888/3270289746156961930.png
I had to remove it from https://danbooru.donmai.us/posts/2428340 to edit its tags, but now I can't add it again.

The error is the following:

ActiveModel::RangeError exception raised
3270289746156961930 is out of range for ActiveModel::Type::Integer with limit 4 bytes

app/controllers/posts_controller.rb:47:in `update'
@evazion
Copy link
Member

evazion commented Jan 13, 2019

The root problem was that illust id parsing was too loose. Effectively, anything that looked like *.pixiv.net/*/1234.jpg was interpreted as an illust id, which was incorrect for img-sketch.pixiv.net urls. This made saving the post fail because the id was too large to store in the post's pixiv_id field.

I tightened up the parsing. Hopefully this won't break anything. Pixiv has a bunch of legacy url formats that we still have to support because they're still used in old posts.

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