Repository navigation
Conversation
…et was down The simple broker keeps nothing for a subscriber that is not connected, so any student status sent while the teacher's socket was reconnecting was lost until the page was reloaded. Student statuses are now fetched again on every connect, including the first one, which also covers statuses posted between the initial request and the socket connecting. The response is merged rather than replacing the list: a workgroup whose status arrived over the socket while any refresh was in flight keeps that status, a fetched status never replaces one with a newer server timestamp, workgroups missing from the loaded config are skipped as retrieveStudentStatuses() does, and only statuses that changed are broadcast. The classroom monitor config reload on newWorkgroupJoinedRun was never subscribed, so new workgroups did not appear. It is now subscribed, debounced and restartable, and an error does not stop later reloads. Re-initializing now deactivates the previous STOMP client and tears down all of its subscriptions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The simple broker keeps nothing for a subscriber that is not connected, so any student status sent while the teacher's socket was reconnecting was lost until the page was reloaded. Student statuses are now fetched again on every connect. This includes the first connect, which also covers statuses posted between the initial
student-statusrequest and the socket connecting.The response is merged rather than replacing the list. A workgroup whose status arrived over the socket while a refresh was in flight keeps that status, since the response may be older. A fetched status also never replaces one with a newer server timestamp, so when refreshes overlap after quick successive reconnects and the earlier one returns last, its older rows are ignored. Statuses received over the socket carry no server timestamp, which is why the in-flight record is still needed. Workgroups missing from the loaded config are skipped, as
retrieveStudentStatuses()does, and only statuses that changed are broadcast, so a reconnect does not re-render every open page.The config reload triggered by
newWorkgroupJoinedRunwas built but never subscribed, so the request was never sent and new teams did not appear. It is now subscribed, debounced so that a burst of teams joining causes one reload, and restartable, and a failed reload does not stop later ones. Re-initializing the service now deactivates the previous STOMP client and tears down all of its subscriptions.Testing: new
teacherWebSocketService.spec.tsand newrefreshStudentStatusestests inclassroomStatusService.spec.ts. On develop three fail and the rest do not compile, since the method does not exist. Full suite: 2507 pass, with one failure that also fails on develop (millisecondsToDateTime(), time zone dependent).