Improve scene training conversation experience - #28
Merged
Conversation
HansonL622
marked this pull request as ready for review
July 31, 2026 08:19
There was a problem hiding this comment.
Summary
One high-confidence authorization/state-isolation issue is called out inline.
Verification: ./mvnw test -q passed; the route and realtime contract checks passed. The frontend Vite build could not run because this checkout has no usable local Vite installation.
Findings without inline locations
backend/unispeaking-server/src/main/java/com/unispeaking/controller/CustomSceneController.java:78: The flow is created without verifying that the authenticated user ownsrequest.sceneId(), andSceneFlowServiceImplstores flows in a process-wide map keyed only bysceneId. Any authenticated user who obtains another scene ID can therefore overwrite that scene's current stage (and read its learning content through/flows/{sceneId}/content), disrupting the owner's training and crossing the scene authorization boundary. Bind the flow to the user/session and enforce ownership on create, advance, content, and complete operations.
HansonL622
force-pushed
the
codex/improve-simulation-experience
branch
from
July 31, 2026 10:19
8ad0d89 to
637101c
Compare
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.
What changed
Why
The previous flow synchronously waited for state extraction before requesting each teacher response, which introduced noticeable dead time. Automatic completion also closed the peer connection as soon as response generation finished, before the browser had necessarily played the final buffered audio. Result routing could retain the sentence-reading stage, causing its pronunciation audio to play behind the report modal.
Impact
Scene practice now responds sooner, preserves the full final utterance, follows new subtitles, shows the report over the ended simulation, and serves teacher previews without a runtime TTS request.
Current status
main(bcfa0ac).637101c.Validation
npm cinpm run buildnpm run check:routes— 32 assertions passednpm run check:realtime-events./mvnw --batch-mode --no-transfer-progress clean verify— 186 tests passed, 0 failures/errorsDocker is not installed in the current local environment, so the Testcontainers PostgreSQL/Redis integration suite was not run locally.