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

Merge stable to develop #2446

Merged
merged 4 commits into from
Aug 2, 2024
Merged

Merge stable to develop #2446

merged 4 commits into from
Aug 2, 2024

Conversation

ReimarBauer
Copy link
Member

Purpose of PR?:

gets the fixes in stable to develop

Needs a merge

matrss added 2 commits July 31, 2024 08:17
On import of mslib.mscolab.server initialize_managers was called once,
hooking events up to handlers in a SocketsManager instance and
initializing the Flask app with the Flask-SocketIO extension. Then, in
handle_start, initialize_managers was called a second time, creating
another SocketsManager object, overwriting the instance saved with the
SocketIO object, and trying to initialize the Flask app with it again.

The last step does not work though, a Flask app can only be initialized
once with each extension (i.e. the sockio.init_app(app) call can only be
done once per Flask app object).

What this led to is that the Flask-SocketIO extension was using the
first SocketsManager object to handle incoming events, while the server
side was using the second SocketsManager object when it called methods
on sockio.sm.

This changes the startup process to do the initialization just once.
Previously test_sockets_manager.py communicated with a MSColab server
running in a different process. This made it impossible to assert
anything on the server state (e.g. on attributes of the SocketsManager
object) due to the process boundary.

Using a test client also simplifies the test setup quite a bit.
@ReimarBauer ReimarBauer requested a review from matrss August 1, 2024 06:19
@ReimarBauer ReimarBauer force-pushed the merge_stable_to_develop branch from 3121a27 to f814dab Compare August 2, 2024 11:15
@ReimarBauer ReimarBauer merged commit 2753b87 into develop Aug 2, 2024
11 checks passed
@ReimarBauer ReimarBauer deleted the merge_stable_to_develop branch August 2, 2024 12:28
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 this pull request may close these issues.

2 participants