-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
bugfix: unhandled exception in disconnect function #3435
bugfix: unhandled exception in disconnect function #3435
Conversation
return view; | ||
try{ | ||
const view = _converse.state.chatboxviews.get('controlbox'); | ||
view.model.set({ 'connected': false }); |
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 is the error/exception that you're seeing?
If it's due to view
not being defined, then you can do:
view?.model.set({ connected: false });
i need something to return in promise because it is async operation in you
fix variant i will return null which will cause blowing somewhere else.
That is why there is no ? operator
…On Mon, 8 Jul 2024 at 16:04, JC Brand ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/plugins/controlbox/utils.js
<#3435 (comment)>
:
> @@ -26,9 +26,12 @@ export function disconnect () {
* we reconnect, "onConnected" will be called,
* to fetch the roster again and to send out a presence stanza.
*/
- const view = _converse.state.chatboxviews.get('controlbox');
- view.model.set({ 'connected': false });
- return view;
+ try{
+ const view = _converse.state.chatboxviews.get('controlbox');
+ view.model.set({ 'connected': false });
What is the error/exception that you're seeing?
If it's due to view not being defined, then you can do:
view?.model.set({ connected: false });
—
Reply to this email directly, view it on GitHub
<#3435 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAT2PMCQIANBDZAZRFGXB5LZLKE5HAVCNFSM6AAAAABKNEWUWSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNRTGI2DSMZZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Regards,
Igor
|
I would still like to know what the actual error is that you're getting, so that I can better understand the underlying issue. Simply wrapping a statement with a blanket try/catch is usually not the best solution. |
this is timing issue , Also , please kindly reject the PR if you consider it not to go to the mainline |
I've merged your commit manually, but then made a change, because I don't think blanket try/catch is usually the right way to go. Also, it doesn't look like the function needs to return anything. |
bugfix: unhandled exception in disconnect function when chat panel is not shown by UI
Thanks for making a pull request to converse.js!
Before submitting your request, please make sure the following conditions are met:
CHANGES.md
document it in
docs/source/configuration.rst
with
make check
or you can run them in the browser by runningmake serve
and then opening
http://localhost:8000/tests.html
.