Discourse Encrypt (for Private Messages)

Are there any errors in this console (when downloading) for this user?

3 Likes

TypeError: I.lookupUncachedUploadUrls(…) is undefined

_discourse-encrypt-b0ceb55ccd75ac5aa08f1b2b40b4aeddc014367f8996981f524f03cb8295c30d.js:1709:57

TypeError: I.lookupUncachedUploadUrls(…) is undefined_discourse-encrypt-b0ceb55ccd75ac5aa08f1b2b40b4aeddc014367f8996981f524f03cb8295c30d.js:1709:57

which is

function lookupAndResolveShortUrlElement(urls, $elements) {
  urls = Array.from(new Set(urls));
  return (0, _uploadShortUrl.lookupUncachedUploadUrls)(urls, _ajax.ajax).then(function () {
    $elements.each(function (_, el) {
      return resolveShortUrlElement($(el));
    });
  });
}
5 Likes

are you able to reproduce the issue or do you need more debug information?

1 Like

I have not been able to find out the cause yet. I see you are running an older version of Discourse 2.4.3 (7f6a321fec8ebdf5c287400cff6bd17d4649362a), probably an older version of the plugin too and we usually test the plugin only with the latest Discourse version.

I recommend you to update your instance and see if you can reproduce it anymore.

3 Likes

Thanks for your reply. I had a look at the changes between 2.4.3 and 2.4.4 and on discourse-encrypt. It doesn’t look that there is any change regarding this issue. So, I don’t think that this issue would be fixed in a newer version.

Current version is 2.5.0.beta5

1 Like

… which is a better and not a version which should be used in production I guess.

The vast majority of production sites are on the beta or tests-passed branch. Relatively few people run on the stable branch, which, as you see, has its own set of problems unless you are very careful about plugin versions.

1 Like

Can you at least rebuild the container? I did try to use the exact same version as you with the latest discourse-encrypt and it worked fine. I find it strange that it works for some user, but it does not for another. It would suggest that there is something strange about that user’s config, maybe some extension blocking the script?

6 Likes

I wanted to test this plugin in my development environment, but that doesn’t seem to work.

Is this supposed to happen in a development environment?
If not, is there a fix?

I installed this plugin just like any other plugin.

1 Like

Looks like the database tables were not created. Make sure to run migrations.

Run LOAD_PLUGINS=1 bundle exec rake db:migrate.

6 Likes

Thank you very much for your fast reply, it worked! :smiley:

However, for some reason some theme components disappear when this plugin is installed.
“Custom Header Links” and “discourse-search-banner” are both gone. When I remove the plugin, these theme components both reappear. Is this just me or is this a bug?
(I have had this issue before with another plugin, which I solved by removing a bug in a javascript file from that plugin)

3 Likes

I am not aware of any incompatibilities and the plugin does not overwrite any templates as far as I know. Do you see any errors in browser’s developer console?

6 Likes

That helped! The problem was a conflict with a plugin that I created using the Beginner's Guide to Creating Discourse Plugins - Part 1.

In that topic you have to create a file plugins/basic-plugin/assets/javascripts/discourse/initializers/alert.js.es6 with this content:

export default {
  name: 'alert',
  initialize() {
    alert('alert boxes are annoying!');
  }
};

The problem is the line name: 'alert',, which also exists in this plugin. I changed it to name: 'alert_something', in my plugin and now everything works perfectly.

Thanks again!

6 Likes

Weird, I don’t see an initializer named alert in discourse-encrypt?

6 Likes

This was the error in the browser’s developer console that gave it away:

It can be solved by either changing the initializer’s name of my custom plugin or by removing discourse-encrypt (or changing its plugin.rb to plugin_something.rb).

I also think it’s weird. If you are really curious, you could create the example plugin explained in Beginner's Guide to Creating Discourse Plugins - Part 1 and see if you can reproduce this error. Perhaps the problem is a little bit different than what it seems to be on my machine.

3 Likes

I am with @eviltrout, not seeing any initializer by this name. I suspect this is some other side effect.

I think we should amend to guide to have better names here, naming a hook “alert” is way too generic.

sample-plugin-alert would be a lot better for our sample plugin.

6 Likes

@udan11 I posted a bug to do with Discourse Encrypt… 'min trust to edit post' setting interfering with Discourse Encrypt:

Thanks!

4 Likes

I don’t think we should show this “I already have an encryption key” message when it’s not activated at all?

image

(also, there doesn’t seem to be validation feedback for what gets put into this field):

5 Likes

Amazing plugin, 100% support it however for non-tech and I-just-clicked-that-what-do-I-do people the reset key pair button is not clear enough so I would recommend changing it into ‘Cancel encryption and reset keys.’ - or something similar, completely fine if not.

2 Likes