Rocket.chat.electron: Rockat.chat update into 2.17.3 leave reference of deleted dictionaries

Created on 4 Feb 2020  ·  22Comments  ·  Source: RocketChat/Rocket.Chat.Electron

My Setup

  • Operating System: Windows 10 1909
  • App Version: 2.17.3
  • Installation type: exe

Description

image
image
image

Current Behavior

I have updated Rocketchat from 2.17.2 to 2.17.3.
I still see the list of old dictionaries used in the old format.
But, they were installed in the dictionaries folder: C:\Program Files\Rocket.Chat\resources\dictionaries
I added the new FR dictionary from chrome.
The correction no longer works. As on the capture we see that no dictionaries are selected. That's why it doesn't work anymore. When I click to select a dictionary present on the disc, I do not have the check mark in the menu.
I do not understand how the list of old format dictionaries is still present.
There are no errors in the console.

Expected Behavior

Using dictionary

spell checker windows bug

All 22 comments

Same here.
I copied dictionary file from c:UsersUserNameAppDataLocalGoogleChromeUser Dataru-RU-3-0.bdic to c:Program FilesRocket.Chatresourcesdictionariesru-RU.bdic but nothing happened.
image

The app always get the list of dictionaries by looking at the directory; nothing is cached besides the list of enabled ones. Is this happening even after restarting the app?

@tassoevan yes, is happening even deleting AppDataRoamingRocket.Chat folder.

@Xarkam @ankar84 What about the %AppData%\Microsoft\Spelling\ directory? Maybe the Windows Spell Checking API is adding files there and the @felixrieseberg/spellchecker module is loading them by default.

@tassoevan no because it's come from Office
image
And I have more fr spelling dictionaries referenced.

I have already searched for all the .dic files on my disks and cannot find anything.
Rocketchat is installed for all users of the machine.

In my listing the fr_FR-3-0 come from chrome.
Even if the references are ghosts, I should be able to use the dictionary coming from chrome. This is not the case.

@Xarkam @ankar84 What about the %AppData%\Microsoft\Spelling\ directory? Maybe the Windows Spell Checking API is adding files there and the @felixrieseberg/spellchecker module is loading them by default.

For me it is 2 folders in c:\Users\UserName\AppData\Roaming\Microsoft\Spelling\ folder
image

I updated to 2.17.5
image
and I can see this:
image
And now I can check ru-RU
image
But spell check don work anyway
image

Then I copied dictionary file from c:\Users\UserName\AppData\Local\Google\Chrome\User Data\ru-RU-3-0.bdic to c:\Program Files\Rocket.Chat\resources\dictionaries\ru-RU.bdic again and restart Rocket.Chat
And now I can not check ru-RU againg
image
Then deleted c:\Program Files\Rocket.Chat\resources\dictionaries\ru-RU.bdic file and restart RC and now I can ckeck ru-RU again but Russian spell check do not work
image

Have tested the latest version.
I can select spelling dictionnary in my list:
image

  1. I selected fr-be but i have no idea where he finds it
  2. I added fr-FR-3-0.bdic from chrome. I can't select he.

If you try to install spelling dictionnary with rocket.chat installed for all users and is not launched as administrator, you ha this error:
image

With version 2.17.7 dictionary selection is much better. And en-US spell checker works fine.
But ru-RU do not checking russian text. How to add Russian spell checker support to Rocket.Chat.Electron?

@ankar84 I've rolled-back to plain text dictionaries (pair of *.aff and *.dic). Are you importing both files?

@ankar84 I've rolled-back to plain text dictionaries (pair of *.aff and *.dic). Are you importing both files?

Yes.
I added dic and aff files from here
I unpacked files, remane it and convert to UTF-8 in Notepad++
dictionaries.zip
But anyway no spell checking...
image

Other issue : https://github.com/RocketChat/Rocket.Chat.Electron/issues/1426

Version 2.17.7 offers few languages. There is no French whereas in a previous version, French was offered.

image

Again, French was not included by default in the past, nor have there been more languages included than your current list. At least not since 2.15 when I started using RC. You must have added it yourself manually. To have more included by default is a different discussion/issue though.

I tested last night under linux (arch) and I added the hunspell dictionary fr without problem by copy, but only with the root account.

I will test the day under windows if the addition goes well.

Sorry but it looks like it is not a manual installation. Several colleagues installed the windows client and the fix worked. Personally, I keep the Windows client up to date to make sure it works properly before encouraging my colleagues to update their client.

Currently, a colleague, with version 2.15.5 has several dictionaries and the correction in French works. He did not do manual installation. Its dictionary folder does not contain the languages ​​offered in the rocketchat menu.

I found issues out.

With this https://github.com/RocketChat/Rocket.Chat.Electron/issues/169 I went back to the sources of Atom https://github.com/atom/node-spellchecker/issues/51.

https://github.com/atom/node-spellchecker/pull/69 and https://github.com/atom/node-spellchecker/issues/54 lets me imagine that a version of Atom allowed in a previous version to search for dictionaries on a PC.

I have not analyzed the rocketchat code. I don't have the skills.

Does this hypothesis seem plausible to you ?
It is not the code of rocketchat but of Atom ?

This could explain why the menu offers dictionaries that are not available in the rocketchat dictionaries folder.

Version :
rc_version

Proposed dictionaries :
rc_langues

Dictionary folder :
rc_directory

Functional correction in French :
rc_correct

I confirm my previous message.

On my computer, I uninstalled the windows client version 2.17.7 by deleting the user data. I installed version 2.15.5. I have not installed additional dictionaries. Spelling correction works in French. Rocktechat offers 20 dictionaries.

Version 2.15.5 : https://github.com/RocketChat/Rocket.Chat.Electron/releases/tag/2.15.5

They are not included in the different ZIPs, nor the DEB. So unless the EXE is the exception, they must be obtained in some other way on your system, or maybe some stale resource folder somewhere.

2.15.5 uses the spellchecker package; until 2.17.5, @felixrieseberg/spellchecker was used. Both state the following:

Native bindings to NSSpellChecker, Hunspell, or the Windows 8 Spell Check API, depending on your platform. Windows 7 and below as well as Linux will rely on Hunspell.

According to https://docs.microsoft.com/en-us/windows/win32/intl/about-the-spell-checker-api:

The user-specific dictionaries for a language, which hold the content for the Added, Excluded, and AutoCorrect word lists, are located under "%AppData%MicrosoftSpelling". The filenames are default.dic (Added), default.exc (Excluded) and default.acl (AutoCorrect). The files are UTF-16 LE plaintext that must start with the appropriate Byte Order Mark (BOM). Each line contains a word (in the Added and Excluded word lists), or an autocorrect pair with the words separated by a vertical bar ("|") (in the AutoCorrect word list). Other .dic, .exc, and .acl files present in the directory will be detected by the spell checking service and added to the user word lists. These files are considered to be read-only and are not modified by the spell checking API.

Please notice that all French dictionary names have hyphens (e.g. fr-FR), indicating they come from the Windows Spell Checking API because Hunspell conventions to use underscores (e.g. en_US).

2.17.7 depends on electron-hunspell which provides only the Hunspell engine consistently across platforms. I've to ascertain @ankar84's report though.

2.17.7 depends on electron-hunspell which provides only the Hunspell engine consistently across platforms. I've to ascertain @ankar84's report though.

I confirm that pre 2.17.7 versions find a lot of system (?) dictionaries, because they have hyphens in their names (like en-US).
image
image

Version 2.17.7 find only dictionaries in folder c:\Program Files\Rocket.Chat\resources\dictionaries\ and one can easy check it by underscores in their names (en_US).
image
image
image

But anyway, I did not find the way to add Russian Spell checker functionality with two different Hunspell dictionaries: one and two
And help in that is appreciated.
image
English Spell checker is works good as you can see.
Update: In devtools on Console I see error:

app.js:6161 Error: ENOENT: no such file or directory, scandir 'C:\Users\username\AppData\Roaming\Rocket.Chat\dictionaries'
getPairsOfDictionaryFiles @ app.js:6161

In there is no such directory
image

Part of code:

const getPairsOfDictionaryFiles = async directoryPath => {
  try {
    return Object.entries((await fs.promises.readdir(directoryPath, {
      encoding: 'utf8'
    })).filter(filename => ['.dic', '.aff'].includes(path.extname(filename).toLowerCase())).reduce((obj, filename) => {
      const extension = path.extname(filename);
      const dictionaryName = path.basename(filename, path.extname(filename));
      return { ...obj,
        [dictionaryName]: { ...obj[dictionaryName],
          [extension.slice(1).toLowerCase()]: path.join(directoryPath, filename)
        }
      };
    }, {})).filter(([, {
      aff,
      dic
    }]) => aff && dic).sort(([a], [b]) => a.localeCompare(b));
  } catch (error) {
    console.error(error);
    return [];
  }
};

Too bad non of that automatic importing has ever worked on Ubuntu (no matter which package was used) : https://github.com/RocketChat/Rocket.Chat.Electron/issues/1077

@Forage Since now we have some fine control over where to look for dictionaries, we don't need to wait for changes in those packages anymore.

Fixed in 3.0
image

Closed by #1737

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thehutman picture thehutman  ·  4Comments

jswolf19 picture jswolf19  ·  4Comments

paulz1 picture paulz1  ·  3Comments

tendo256 picture tendo256  ·  4Comments

geekgonecrazy picture geekgonecrazy  ·  4Comments