FrostCo / AdvancedProfanityFilter

A browser extension to filter profanity from webpages
GNU General Public License v3.0
164 stars 26 forks source link

Failed to populate stats. [Error: TypeError: Cannot read properties of undefined (reading 'list')] #329

Closed Jon-Ayden closed 3 years ago

Jon-Ayden commented 3 years ago

Instructions: This template is written in Markdown. Click the "Preview" tab to see what it will look like when submitted. Fill in the applicable sections (you can erase the examples if you'd like).

:bug: Description

"Failed to populate stats. [Error: TypeError: Cannot read properties of undefined (reading 'list')]"

Error pops up after saving a bulk edit. If I backup my list and restore to default settings, the error does not appear. When I restore my settings, the error appears. Despite the error message, my changes are saved, so the error does not seem to impact my settings

:twisted_rightwards_arrows: Steps To Reproduce

  1. Go to 'Bulk Editor'
  2. Click on 'Save'
  3. Add custom words
  4. See error

:heavy_check_mark: Expected behavior

List to save without issue or error

:camera: Screenshots

If applicable, add screenshots to help explain your problem.

:computer: Details

:pencil: Additional context

I have been able to save my own words to the bulk list without issue in the past, so this is a recent issue.

richardfrost commented 3 years ago

Interesting.. I've tried a few combinations and haven't been able to get that error to appear. Would you mind sharing your config, either here or in an email to me? Unless you can figure out a predictable way to make the error appear from the defaults settings.

Jon-Ayden commented 3 years ago

In case you did not get my file by email. As a side point, I understand that in the Bulk Editor the Substitution Case is meant to use your custom word as a substitution rather than censoring it if Censor is the selected Filter Method. If that understanding is correct, it is not substituting my selected words but instead censoring them along with the rest of the list that does not have Sub Case selected. I suppose I could just place asterisks as the replacement words for the whole list save for the few words and have the Filter Method on Substitute.

{
  "audioWordlistId": 1,
  "censorCharacter": "*",
  "censorFixedLength": 1,
  "collectStats": false,
  "customAudioSites": null,
  "darkMode": false,
  "defaultSubstitution": "censored",
  "defaultWordMatchMethod": 0,
  "defaultWordRepeat": 0,
  "defaultWordSeparators": 0,
  "domains": {
    "jw.org": {
      "disabled": true
    }
  },
  "enabledDomainsOnly": false,
  "fillerAudio": "",
  "filterMethod": 0,
  "filterWordList": false,
  "iWordWhitelist": [
    "opposite sex"
  ],
  "muteAudio": true,
  "muteAudioOnly": false,
  "muteCueRequireShowing": false,
  "muteMethod": 0,
  "password": null,
  "preserveCase": true,
  "preserveFirst": false,
  "preserveLast": false,
  "showCounter": true,
  "showSubtitles": 0,
  "showSummary": true,
  "showUpdateNotification": true,
  "substitutionMark": false,
  "wordWhitelist": [],
  "wordlistId": 1,
  "wordlists": [
    "Wordlist 1",
    "Wordlist 2",
    "Wordlist 3",
    "Wordlist 4",
    "Wordlist 5",
    "Wordlist 6"
  ],
  "wordlistsEnabled": true,
  "words": {
    "bench": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "bench"
    },
    "boob": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    },
    "bruh": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "bruh"
    },
    "bullcrap": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 1,
      "sub": ""
    },
    "butt": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "butt"
    },
    "butts": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 0,
      "sub": "butts"
    },
    "chest": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "chest"
    },
    "christ": {
      "case": 0,
      "lists": [],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    },
    "cool": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 1,
      "sub": "cool"
    },
    "crap": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 2,
      "repeat": 1,
      "separators": 0,
      "sub": "crap"
    },
    "dang": {
      "case": 0,
      "lists": [],
      "matchMethod": 1,
      "repeat": 0,
      "separators": 0,
      "sub": "dang"
    },
    "dangit": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 1,
      "sub": "dangit"
    },
    "dick": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 2,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    },
    "dumbo": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "dumbo"
    },
    "dumbos": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "dumbos"
    },
    "expletive": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "expletive"
    },
    "freak": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 2,
      "repeat": 1,
      "separators": 1,
      "sub": "freak"
    },
    "freaked up": {
      "case": 1,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 0,
      "sub": "messed up"
    },
    "gay": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "gay"
    },
    "gays": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "gays"
    },
    "goddang": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 1,
      "sub": ""
    },
    "heck": {
      "case": 0,
      "lists": [],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 0,
      "sub": "heck"
    },
    "idiot": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "idiot"
    },
    "jerk": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 1,
      "sub": "jerk"
    },
    "jesus": {
      "case": 0,
      "lists": [],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    },
    "man": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "man"
    },
    "pee": {
      "case": 0,
      "lists": [],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "pee"
    },
    "penis": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 2,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    },
    "people": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "people"
    },
    "sex": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    },
    "softie": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "softie"
    },
    "softies": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 0,
      "repeat": 1,
      "separators": 0,
      "sub": "softies"
    },
    "suckup": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 1,
      "sub": "suckup"
    },
    "ticked": {
      "case": 0,
      "lists": [],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "ticked"
    },
    "tramp": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 1,
      "repeat": 1,
      "separators": 0,
      "sub": "tramp"
    },
    "vagina": {
      "case": 0,
      "lists": [
        1
      ],
      "matchMethod": 2,
      "repeat": 0,
      "separators": 0,
      "sub": ""
    }
  },
  "youTubeAutoSubsMax": 0,
  "youTubeAutoSubsMin": 0
}
richardfrost commented 3 years ago

Thanks for sending that in. I didn't get your previous email, but this helped me track down the bug. I'll try to get it patched tonight or tomorrow morning.

On to your question about the bulk editor, Substitution Case is simply an option for the substituted word to match the case (capitalization) of the word its replacing. This only applies when you are using the Substitution filter mode, and will be ignored if you are using another like Censor. As an example, it will replace WORD with REPLACEMENT instead of replacement. It helps make the substitution feel more natural.

Right now there is no way to have multiple filter modes active at the same time. Its not really something I'm planning to do unless I hear a pretty compelling use-case. You can do as you describe and manually "censor" a replacement word with * or whatever you'd like if that is helpful.

richardfrost commented 3 years ago

This should now be fixed when the extension updates (automatically) to version 2.24.1. Let me know once you get a chance to test it and if its resolved we'll go ahead and close this issue.

Jon-Ayden commented 3 years ago

I went in to the bulk editor, and pressed Save (without adding any word, because in the past just clicking Save would bring the error message) and the error message no longer appears! Thanks for quickly fixing this. Also, thank you for your explanation of the other issue. Awesome work 👍🏻

On Wed, Sep 8, 2021, 12:03 AM Richard Frost @.***> wrote:

This should now be fixed when the extension updates (automatically) to version 2.24.1 https://github.com/richardfrost/AdvancedProfanityFilter/releases/tag/2.24.1. Let me know once you get a chance to test it and if its resolved we'll go ahead and close this issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/richardfrost/AdvancedProfanityFilter/issues/329#issuecomment-914917080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVLIOZZIK3APQE67UUJXIZTUA3VALANCNFSM5C4EVW3A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

richardfrost commented 3 years ago

You're welcome! Thanks for your sharing your config so I could track it down faster.