-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix: pollId equals 0 #3650
fix: pollId equals 0 #3650
Conversation
02dedd5
to
8899710
Compare
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.
Your approach aborts the watch, but it should still run, if no poll is loaded.
Instead the watch at the server side should just avoid the the db request and continue watching other poll`s changes to keep the polls list up to date.
The watch is meant to watch changes in the current poll and the polls list.
A better approach would be to simply skip searching for a poll, if the id is 0 here: polls/lib/Service/WatchService.php Lines 38 to 41 in 32d0410
|
8899710
to
6610d80
Compare
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.
Ay. This will also result in an interruption of the watcher. If no pollId (aka 0) is given, the watcher should just not search for a poll, but still keep watching for changes.
I meant skipping the line 44 in case of no pollId given.
The job for the watcher is to wait for updates of the polls table and then return the changes back to the client to enable the client for real time updates.
Additionally, if a pollId is given, it deep watches for changes of the particular poll also (Votes, Option, comments, etc.).
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
6610d80
to
1383ced
Compare
fix #3649