Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTHER] Rocket.Chat Apps #9666

Merged
merged 61 commits into from
Feb 20, 2018
Merged

[OTHER] Rocket.Chat Apps #9666

merged 61 commits into from
Feb 20, 2018

Conversation

graywolf336
Copy link
Contributor

Adds the initial not fully implemented Rocket.Chat Apps. We are intentionally not including a lot of information about this pull request and the features it adds. Mostly because they are disabled by default, can not be enabled unless you add the right things to the environment (:wink:), and are a very much work in progress. Why are we adding it then? So that the people who are wanting to use it and know about it can test it and so we can test it before recommending it for production usage.

If you would like more information about this new feature and the plan for it, please contact me on Rocket.Chat's Open Community server. :)

cc: #6890

…r when disabling a command that is already disabled
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9666 February 9, 2018 19:33 Inactive
@graywolf336 graywolf336 requested a review from rodrigok February 9, 2018 19:39
@graywolf336 graywolf336 added the Feature: Request Requested Feature label Feb 9, 2018
@graywolf336 graywolf336 added this to the 0.62.0 milestone Feb 9, 2018
@JSzaszvari
Copy link
Contributor

images 12

Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass one :)

Maybe add a README.md to base and define what Orchestrator, bridge and a few other terms specific to apps?

if (got.info && got.logs) {
this.ready.set(true);
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if these both finish at the same time? Maybe should wrap this in something that will catch both of these like Q.all ?

Because what if they finish at the same time I think extremely tiny chance, but might happen that neither execute: this.ready.set(true)


got.settings = true;
if (got.info && got.settings) {
this.ready.set(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with these 2 parallel promises

this.orch = orch;
this.streamer = new Meteor.Streamer('apps');

this.streamer.on('app/added', this.onAppAdded.bind(this));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you define these as arrow function you won't have to do .bind(this) because the arrow functions don't create new scope.

onAppAdded = (appId) => {

}

Not really a change request. Just could avoid having to do this unfortunate bind junk :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As that's a es7 feature and we are using eslint for es6, that style of development isn't possible. Also, the default scope of this in class functions is the class however the Meteor.Streamer messes with the scope and thus is what required the additional .bind(this) on setting the streamer callbacks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per conversation -- due to something in meteor and/or the streamer we can use arrow functions there

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9666 February 19, 2018 20:37 Inactive
@geekgonecrazy
Copy link
Contributor

I think i've said this before.... But: Really like the simplicity of using the streamer for listening for server side events. Makes it much simpler to understand the flow of data.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9666 February 19, 2018 20:48 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9666 February 19, 2018 20:49 Inactive
@RocketChat RocketChat deleted a comment Feb 19, 2018
@RocketChat RocketChat deleted a comment Feb 19, 2018

this._addAdminMenuOption();

const loadLangs = setInterval(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... is there another way other than setting an interval? I thought meteor had a way to add a callback when its ready.

'Accounts_OAuth_Wordpress_secret', 'Push_apn_passphrase', 'Push_apn_key', 'Push_apn_cert', 'Push_apn_dev_passphrase',
'Push_apn_dev_key', 'Push_apn_dev_cert', 'Push_gcm_api_key', 'Push_gcm_project_number', 'SAML_Custom_Default_cert',
'SAML_Custom_Default_private_key', 'SlackBridge_APIToken', 'Smarsh_Email', 'SMS_Twilio_Account_SID', 'SMS_Twilio_authToken'
];
Copy link
Contributor

@geekgonecrazy geekgonecrazy Feb 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a todo, to add a way to mark a setting as containing a secret, that way could just block access to settings containing secrets. Long term maintaining this internal list... not fun

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New issue created to reflect this: #9790

instance.settings.set(results[1].settings);
this.ready.set(true);
}).catch(() => {
//TODO: error handling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just toss an error for now? That way if this is hit during testing, we at least know where it was?

Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@rodrigok rodrigok merged commit 30b0a43 into develop Feb 20, 2018
@rodrigok rodrigok deleted the rocketlets branch February 20, 2018 22:57
@rodrigok rodrigok mentioned this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Request Requested Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants