Repository navigation
Conversation
…eams When a new workgroup joins the run, each period's classroom topic sends a newWorkgroupJoinedRun message and the classroom monitor calls ConfigService.retrieveConfig() to refresh its roster. retrieveConfig() returns a cold HTTP observable and nothing subscribed to it, so the request was never made, and the roster stayed as it was when the monitor loaded until the teacher reloaded or changed a team through manage students. The message now feeds a subject that requests the config at most once every two seconds. auditTime is used rather than debounceTime so the roster keeps refreshing while a class is still joining, instead of waiting for the joins to stop. A failed request is swallowed so later joins still refresh, and initialize() replaces any earlier pipeline instead of adding a second one. With the roster refreshing, the period selector counts and manage students update as teams join, and the other monitor views pick up the new team the next time they initialize instead of only after a reload. Anonymized discussion views compute pseudonyms from the roster, so this should land after the change that keeps those pseudonyms stable when the roster changes mid-session.
The roster refresh audits newWorkgroupJoinedRun messages and maps each audit tick to a config request with switchMap. While a class keeps joining, the audit window closes again every few seconds and switchMap cancels the request still in flight. If the config endpoint takes longer than the window to answer, no request completes until the joins stop. Use concatMap instead so each request runs to completion and the request for the latest joins still runs after the one before it.
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 classroom monitor does not pick up teams that join the run after the teacher opened it. When a workgroup joins, each period's classroom topic sends
newWorkgroupJoinedRunandTeacherWebSocketServicecallsConfigService.retrieveConfig()to refresh the roster, butretrieveConfig()returns a cold HTTP observable and nothing subscribes to it, so the request is never made. The roster stays as it was when the monitor loaded until the teacher reloads or changes a team through Manage Students, whose dialogs do subscribe.At the start of a lesson, while students join with the access code, the period selector counts and Manage Students stay short, and Student Progress, Grade by Step and the grading lists never show the newcomers, however often the teacher reopens them. Work from those teams appears with an empty name where names are looked up from the roster.
Changes
auditTimerather thandebounceTime, so the roster keeps refreshing while a class is still joining. There is one teacher tab, so no jitter. Each request is mapped withconcatMapand runs to completion, so a server slower than the window still answers during a burst. A failed request is swallowed so later joins still refresh, andinitialize(), which runs each time a unit's monitor opens, replaces any earlier pipeline.Anonymized discussion views compute pseudonyms from the roster, so this should be merged after #2394, which keeps those pseudonyms stable when the roster changes mid-session.
Test
teacherWebSocketService.spec.ts: the config is requested, once for a burst of joins, repeatedly while joins keep arriving one second apart, again after a failed request, and through one pipeline after a secondinitialize(). Against the currentdevelop, all five fail, e.g.Expected 0 to equal 1.andExpected 0 to be greater than or equal 3.should finish slow config requests while joins keep arriving: with a request slower than the window, requests still complete while joins continue. WithswitchMapit fails withExpected 0 to be greater than or equal 2.