Skip to content

Ensure actor on error objects when possible #558

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

Merged
merged 9 commits into from
Sep 2, 2021

Conversation

silverbucket
Copy link
Member

Resolves #492

@silverbucket silverbucket added type:bug state:ready kredits-2 Medium contribution package:core Issues related to Core Sockethub package labels Aug 30, 2021
@silverbucket silverbucket requested a review from raucao August 30, 2021 16:30
@silverbucket silverbucket self-assigned this Aug 30, 2021
@raucao
Copy link
Contributor

raucao commented Aug 30, 2021

Great!

Could we also ensure that failure messages do not create additional error messages that contain the same data perhaps? Or is this intentional, so that one is for the software to read, and the other one actually for the user?

@raucao
Copy link
Contributor

raucao commented Sep 1, 2021

I believe this question is still open? (Just generally, not blocking this PR.)

Could we also ensure that failure messages do not create additional error messages that contain the same data perhaps? Or is this intentional, so that one is for the software to read, and the other one actually for the user?

Copy link
Contributor

@raucao raucao left a comment

Choose a reason for hiding this comment

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

Hmm, with this branch I'm now getting all error messages twice from Sockethub:

Screenshot from 2021-09-01 18-41-27

Copy link
Contributor

@raucao raucao left a comment

Choose a reason for hiding this comment

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

As @galfert verified on chat, the double-message issue is a new bug in Hyperchannel. So I think this is ready to merge.

@silverbucket
Copy link
Member Author

@galfert @raucao - OK, I've simplified things:

  1. Any job failures, callback is used. In XMPP I was using both the cb() and sendToClient, for no reason other than to be confusing I guess.
  2. Platform.ts ensures that the callback can only be used once (ignores subsequent calls)
  3. Don't throw an error when not necessary, instead use fail callback.

Can I get a final OK just to be sure?

@raucao
Copy link
Contributor

raucao commented Sep 2, 2021

OK, so now I found out why Hyperchannel isn't logging the failure messages for the connect. Instead of the normal "failure" event name, which other failures do use, this one uses the event name "failed".

I think we need to manually ensure that these are all consistent for now. But in the future, trying to send unknown event names should probably cause at least a console warning, or ideally a linting error.

@silverbucket silverbucket merged commit 1eb4fdd into master Sep 2, 2021
@silverbucket silverbucket deleted the ensure-actor-when-possible branch September 2, 2021 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kredits-2 Medium contribution package:core Issues related to Core Sockethub package state:ready type:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect error AS object should contain actor/target
2 participants