Conversation
- Added logSafe function to safely log messages without throwing errors. - Introduced errorCode function to extract loggable failure codes from errors. - Updated IMQClient to log responses with no pending calls. - Modified @Logged() decorator to log class and method names instead of error objects. - Added unit tests for logging helpers and response visibility.
Contributor
|
All contributors have signed the @imqueue Contribution Terms. ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
1 similar comment
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Mikhus
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Two diagnostics changes, both written through the configured logger.
@logged()now writesClass.method() failed, code <code>instead of dumping the caught error. Two methods failing with the same error used to produce two indistinguishable dumps, and a dump could carry personal data, or the call arguments an imq error keeps in its properties. The code is allow-listed only — anIMQ_-prefixed framework code, a systemE…code, a small integer, a known Redis reply code or one of a few known Redis-client failure messages mapped to codes of our own; everything else, the error's class name included, becomesunknown. The method name now also reaches the line under standard (TC39) decorators, where it was previously unavailable, and a static method reports its real class instead ofFunction. Everything else is unchanged: which logger is resolved,doNotThrow, the re-thrown value, and the fact that a throwing logger replaces the original error.IMQClientnow warns about every response which arrives with no pending call left, naming the service, the method and the request id. That tells a late reply apart from a service which never answered, and after a restart it names the backlog the previous process left behind. The response object itself is never logged — it echoes the whole request back, arguments included — and the existingEventEmitterhand-off for such messages is untouched.No control flow, return value, timeout mechanics or public API changed.
Type of change
Checklist
npm test).Contribution terms (required)
I grant the project owner the right to license my contribution
commercially, royalty-free, my contribution stays available under
GPL-3.0, I keep my copyright, and I understand I will receive no fee for
it. If I did not agree, I would not be submitting this contribution.