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

Impossible to handle :chsk/bad-package properly #346

Closed
p-himik opened this issue Aug 24, 2019 · 2 comments
Closed

Impossible to handle :chsk/bad-package properly #346

p-himik opened this issue Aug 24, 2019 · 2 comments

Comments

@p-himik
Copy link
Contributor

p-himik commented Aug 24, 2019

Consider a scenario where a client cannot decode a message sent by a server. In this case, it results two messages in the JS console:

DEBUG [taoensso.sente:210] - Bad package: <bad_data> <decode_error>
WARN [taoensso.sente:1094] - Cb reply w/o local cb-fn: :chsk/bad-package

The warning message is created by this piece of code:

(if-let [cb-uuid ?cb-uuid]
  (if-let [cb-fn (pull-unused-cb-fn! cbs-waiting_
                                     cb-uuid)]
    (cb-fn clj)
    (warnf "Cb reply w/o local cb-fn: %s" clj))
  (let [buffered-evs clj]
    (receive-buffered-evs! chs buffered-evs)))

The issue is that in the problematic case, cb-uuid is set to the bad_data. It's not nil so the error gets sent into the console and nowhere else.

@Folcon
Copy link

Folcon commented Mar 8, 2020

I'm putting this here because I think this is related to the current issue, if not, happy to open a new one.
The current situation isn't much better, printing this in console:

#error {:message "Invalid event", :data {:given :chsk/bad-package, :errors {:wrong-type 
{:expected :vector
 :actual {:type, :value :chsk/bad-package}}}}}

I can usually debug this by slowly filtering out stuff until I get to what's wrong, it would be useful if it stated what value was at fault?

@ptaoussanis ptaoussanis self-assigned this Feb 23, 2023
@ptaoussanis ptaoussanis added this to the v1.18 milestone Feb 23, 2023
@ptaoussanis
Copy link
Member

@p-himik, @Folcon Apologies for such a long delay replying!

Thanks both for pinging about this, will be fixed in forthcoming v1.18 release 👍

ptaoussanis added a commit that referenced this issue Mar 7, 2023
This was unfortunately preventing clients from manually handling malformed packages,
and leading to confusing errors (e.g. #340).
ptaoussanis added a commit that referenced this issue Mar 7, 2023
This was unfortunately preventing clients from manually handling malformed packages,
and leading to confusing errors (e.g. #340).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants