gled-rs / mastodon-autofollow

Autofollow bot for mastodon
29 stars 9 forks source link

Fix skipping of #nobot accounts #17

Closed Fusl closed 7 years ago

Fusl commented 7 years ago

Should fix #15

Rushyo commented 7 years ago

Note: This won't work in the edge case of any variation of #nobot in the bio, such as "#nobot, someotherstuff" with the punctuation attached. Removing the HTML tags before checking would be a more accommodating approach.

Fusl commented 7 years ago

Just tried this and the notes appear as

This is a test <a ...>#<span>nobot</span></a>, someotherstuff
Rushyo commented 7 years ago

Oh, fair enough, ignore me. It still won't work on my test case (#nobotanicalgardens), but perhaps that's just me being overly cautious. When I conceived of #nobot I did so in the expectation that, if it took off, people would put it in their bio in weird and wonderful ways, like they have with similar solutions I've encountered.

Fusl commented 7 years ago

#nobotanicalgardens != #nobot and that's how it should be handled

Rushyo commented 7 years ago

I do not think the onus is on the user to "correctly" implement #nobot. The onus resides with the bot to handle all quirk cases correctly. The user's expectation is putting #nobot somewhere in their profile will fix the issue. Not that it be implemented in an easily-parsable manner; the user has no idea what that is.

In addition, false positive hits have a far reduced impact than false negatives.

Further to even that, free text-parsing an in-complete HTML fragment based on an undefined API behaviour is not a stable fix. It will break if the API's non-contractual behaviour is even mildly altered. If the user's bio were "well-behaved" this would be fine, but there's no assurance of such.

Given the above arguments, I just don't see the need for a hotfix as opposed to a stable patch that parses the HTML and treats quirk cases as potential false negatives.

To put it in context: There's a lynch mob currently looking for solutions to this problem. Nobody asked for these bots on their instances. #nobot was offered as a middle ground. If it doesn't work flawlessly in practice for the users, more stringent technical and social measures will be taken against the bots and those who use them. There's already enough swearing and high blood pressure going on. Everyone loses.

gled-rs commented 7 years ago

Thanks for the report and the fix !