zigdon / xkcd-Bucket

Bucket is the channel bot for #xkcd
http://wiki.xkcd.com/irc/Bucket
121 stars 31 forks source link

Bucket should clean up circular aliases during merges #119

Open dgw opened 6 years ago

dgw commented 6 years ago

Let Bucket have two factoids: thing, which contains tidbits; and other thing, which is an alias to thing.

The only entry in other thing is <alias> thing. If an admin issues Bucket, merge thing => other thing, all of the tidbits in thing will be moved to other thing, and thing will become just <alias> other thing. But other thing will still contain <alias> thing.

Merging factoids together should not result in circular aliases. If the target factoid is already an alias, Bucket should either refuse to merge (probably sensible if it points elsewhere) or remove the alias from the target before merging (sensible if the target points to the source factoid).