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

Chat messages not restored on refresh #1361

Closed
axelboc opened this issue Aug 22, 2024 · 4 comments · Fixed by #1364
Closed

Chat messages not restored on refresh #1361

axelboc opened this issue Aug 22, 2024 · 4 comments · Fixed by #1364

Comments

@axelboc
Copy link
Collaborator

axelboc commented Aug 22, 2024

GET /remoteaccess/chat throws a silent error like in #1355, so the messages aren't retrieved.

Traceback (most recent call last):
  File "/home/bocciare/tools/micromamba/envs/mxcubeweb/lib/python3.10/site-packages/flask/app.py", line 880, in full_dispatch_request rv = self.dispatch_request()
  File "/home/bocciare/tools/micromamba/envs/mxcubeweb/lib/python3.10/site-packages/flask/app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
  File "/home/bocciare/tools/micromamba/envs/mxcubeweb/lib/python3.10/site-packages/flask_security/decorators.py", line 432, in decorated_view return current_app.ensure_sync(fn)(*args, **kwargs)
  File "/home/bocciare/workspace/mxcubeweb/mxcubeweb/routes/ra.py", line 215, in get_all_mesages return jsonify({"messages": app.chat.get_all_messages()})
  File "/home/bocciare/workspace/mxcubeweb/mxcubeweb/core/components/chat.py", line 40, in get_all_messages "username": _m.username,

AttributeError: 'Message' object has no attribute 'username' 
@marcus-oscarsson
Copy link
Member

Hm, I think I fixed that I while back, or maybe this is new error of the same type. Have to double check.

@axelboc
Copy link
Collaborator Author

axelboc commented Aug 23, 2024

Can't reproduce this morning. 🤔 Maybe my local database was corrupted.

@axelboc axelboc closed this as completed Aug 23, 2024
@axelboc
Copy link
Collaborator Author

axelboc commented Aug 23, 2024

Ah yes, one has to have messages to restore. If no messages were sent before refreshing, the response is correct: { "messages": [] }

@axelboc axelboc reopened this Aug 23, 2024
@marcus-oscarsson
Copy link
Member

:), I have a local fix for this that I have not made a PR for yet. I'm not super happy with as it is but Ill make a draft PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants