Phase 3: closing-overlay fix + goodbye-composer dedupe

Customer chat refreshSessionStatus now clears sessionExpired carryover so the
goodbye composer renders correctly when re-opening a closing session from
history. Backend /api/shared/chat/:id/info returns goodbye_submitted_by_me;
both apps suppress the composer for the side that has already submitted and
render an awaiting-banner view instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-27 13:43:19 +08:00
parent 05ab1e10df
commit 6801001b64
6 changed files with 157 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
import { authenticate } from '../../plugins/auth.js'
import { getMessages } from '../../services/chat.service.js'
import { getSessionClosures } from '../../services/closure.service.js'
import { getSessionClosures, hasUserSubmittedClosure } from '../../services/closure.service.js'
import { registerDeviceToken } from '../../services/notification.service.js'
import { flipSessionSensitivity } from '../../services/sensitivity.service.js'
import { getDb } from '../../db/client.js'
@@ -55,7 +55,8 @@ export const sharedChatRoutes = async (app) => {
if (!session) {
return reply.code(404).send({ success: false, error: { code: 'NOT_FOUND', message: 'Session not found' } })
}
return reply.send({ success: true, data: session })
const goodbyeSubmittedByMe = await hasUserSubmittedClosure(sessionId, request.userType)
return reply.send({ success: true, data: { ...session, goodbye_submitted_by_me: goodbyeSubmittedByMe } })
})
// Get full transcript (read-only, for history)