Code Monkey home page Code Monkey logo

Comments (4)

Krinkle avatar Krinkle commented on July 18, 2024

This still causes exceptions to be logged to #cvn-broadcast from time to time.

CVNBot14: *DD/1.0*ERROR*ReactorException*Key duplication when adding: watchword*#commons.wikimedia [[Special:Log/upload]] upload * Ludvonga *  uploaded "[[File:Malolotja.jpg]]": {{Information |Description    ={{en|1=Malolotja Nature Reserve - Frokostudsigt}} |Source         =https://www.flickr.com/photos/shevy_dk/5703043684 |Author         =René C. Nielsen |Date           =2011-05-05 |Permission     = |oth

from labs-countervandalism-cvnbot.

Krinkle avatar Krinkle commented on July 18, 2024

A better fix would be to fix the logic problem in cases like the below:

                    // Check if the edit summary matches BES
                    listMatch ubes2 = listman.matchesList(r.comment, 20);
                    if (ubes2.Success)
                    {
                        attribs.Add("watchword", ubes2.matchedItem);
                        attribs.Add("lmreason", ubes2.matchedReason);
                        uMsg = 95620;
                    }

                    // Now check if the title matches BES
                    listMatch ubes1 = listman.matchesList(r.title, 20);
                    if (ubes1.Success)
                    {
                        attribs.Add("watchword", ubes1.matchedItem);
                        attribs.Add("lmreason", ubes1.matchedReason);
                        uMsg = 95620;
                    }

There are bound to be cases where a watchword occurs in both the title and the edit summary (for example), or for an edit to match both an edit-summary watchword and e.g. a "bad user name" pattern.

In those cases the end result is that the last match wins. As such, we should reverse these code blocks for the most important (winning match) to happen first instead last, and then either return early or place the rest in an "else" block so that they don't happen and thus we don't try to add attributes for messages we no longer use.

Doing so would also avoid conflicts where e.g. we match A first and add a few attributes and set uMsg, but then match something else and end up overwriting some attributes (triggers the warning), but also leaving behind unrelated ones.

from labs-countervandalism-cvnbot.

Krinkle avatar Krinkle commented on July 18, 2024

Still seen:

CVNBot14> DD/1.0ERRORReactorExceptionItem has already been added. Key in dictionary: 'watchword' Key being added: 'watchword'#commons.wikimedia [[Special:Log/upload]] upload * Lyokoï * uploaded "[[File:LL-Q150 (fra)-Lyokoï-foutre la merde.wav]]"

from labs-countervandalism-cvnbot.

Krinkle avatar Krinkle commented on July 18, 2024

Re-closing. Assumed fixed in master, but wasn't deployed yet. See #50.

from labs-countervandalism-cvnbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.