-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some neckbeard comments.
src/api/services/channel.ts
Outdated
const mainAction = this.subscriptions.has(action) | ||
? this.subscriptions.get(action) | ||
: (payload: any, id: ServiceIdentity) => this.defaultAction(action, payload, id); | ||
const a = this.preAction ? await this.preAction(action, payload, senderIdentity) : payload; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets get some meaningful variable names here.
this.serviceMap.set(serviceIdentity.uuid, channel); | ||
return channel; | ||
} catch (e) { | ||
throw new Error(e.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two questions:
-
Why not
throw e
? -
if we are not handling the error in any meaningful way, why catch at all ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we are catching is a nack from the core which is coming through as a RuntimeError, when this could very well be an intentional error from the user (ie authenticated Service). I'm catching it an throwing it back as a regular error because in those cases it is not a runtime error.
src/api/services/index.ts
Outdated
} | ||
|
||
public async register(): Promise<Provider> { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do without this try/catch.
src/api/services/channel.ts
Outdated
} | ||
|
||
public register(topic: string, listener: Action) { | ||
//TODO create map of subscriptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this TODO still relevant?
* RUN-3996 fixed a multi-runtime regression (#109) * V bump.30.2 (#110) (#111) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3999 multi runtime tests config update (#112) * V bump.30.2 (#110) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3999 Update multi runtime tests config * Bug/run 3965 multi runtime cache clearing issue (#114) * V bump.30.2 (#110) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3965 Fix EPERM: operation not permitted * RUN-3965 Fix some cache folders not deleted issue * RUN-4017/services (#113) * passing tests * made changes * RUN-4028 - Async add listener (#115) * V bump.30.2 (#110) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * some test fixes * more timeouts in tests * altered tests to check for awaiting newlistener * undo unnecessary edit * fix types of registereventlistener and unregister * hold, fixed removeAllListeners but need to test * added some tests * added testing * cleanup * fix prependonce * bit more testing * revert test changes * changed class name, some cleanup * make tests match new best practices * name of test file * tests cleanup * back to arrows for tslint * bind rawsend (#116) * RUN-4045 register window name early in creation (#117) * RUN-4033 plugin.import accepts a string (#118) * Feature/test sledghammer (#119) * sledghammer approach to fixing tests. * taking a sledghammer to our Multi runtime tests. * Moving back to es6 untill we hit a major version. * A few items from the code review. * code review items. * code review items. * V bump.30.2 (#110) (#121) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3898 - External services tests (#120) * hiold * hold * tests for external services re RUN-3898 * clean up * Test fixed, no longer leaving around runtime (#122) * test fixed, no longer leaving around runtime * cleanup * Fixed issue with the webpack grunt task where it was not reporting the errors correctly (#123) * Fixed issue with the webpack grunt task where it was not reporting the errors correctly * Passing error codes instead of arrays. * version bump. (#124)
* RUN-3996 fixed a multi-runtime regression (#109) * V bump.30.2 (#110) (#111) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3999 multi runtime tests config update (#112) * V bump.30.2 (#110) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3999 Update multi runtime tests config * Bug/run 3965 multi runtime cache clearing issue (#114) * V bump.30.2 (#110) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3965 Fix EPERM: operation not permitted * RUN-3965 Fix some cache folders not deleted issue * RUN-4017/services (#113) * passing tests * made changes * RUN-4028 - Async add listener (#115) * V bump.30.2 (#110) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * some test fixes * more timeouts in tests * altered tests to check for awaiting newlistener * undo unnecessary edit * fix types of registereventlistener and unregister * hold, fixed removeAllListeners but need to test * added some tests * added testing * cleanup * fix prependonce * bit more testing * revert test changes * changed class name, some cleanup * make tests match new best practices * name of test file * tests cleanup * back to arrows for tslint * bind rawsend (#116) * RUN-4045 register window name early in creation (#117) * RUN-4033 plugin.import accepts a string (#118) * Feature/test sledghammer (#119) * sledghammer approach to fixing tests. * taking a sledghammer to our Multi runtime tests. * Moving back to es6 untill we hit a major version. * A few items from the code review. * code review items. * code review items. * V bump.30.2 (#110) (#121) * RUN-3996 fixed a multi-runtime regression (#109) * Version bump to 30.2 * RUN-3898 - External services tests (#120) * hiold * hold * tests for external services re RUN-3898 * clean up * Test fixed, no longer leaving around runtime (#122) * test fixed, no longer leaving around runtime * cleanup * Fixed issue with the webpack grunt task where it was not reporting the errors correctly (#123) * Fixed issue with the webpack grunt task where it was not reporting the errors correctly * Passing error codes instead of arrays. * version bump. (#124)
Passed tests on local machine