E2E Bot Test 001 — Mattermost Integration

Run ID: run-verify-e2e-bot-001-20260316-1208 | 2026-03-16 12:08

Overall: FAIL (7/8 passed)

Test Results

BlockDescriptionStatusDetails
V1Order notification in #ops-alertsPASSOrder PZ-TEST-BOT-160912 created, notification found within 5s
V2Route channel createdPASSChannel 'route-20260317-k-5ab7' created, welcome post with technician info found
V3Client support chatPASS200 response with channelId=support-1a6299c0, DB record confirmed
V4Client order threadPASS200 response with threadId, mm_order_thread record created
V5Support historyFAIL502 'Chat service unavailable' — getPostsForChannel API mismatch
V6Token proxyPASSToken returned, verified: username test.dispatcher.bot
V7Route completion notificationPASS'Маршрут завершён' posted in route channel with archive timer
V8Idempotency checkPASSSame channelId on repeat, only 1 support channel in DB

Test Data

OrderPZ-TEST-BOT-160912 (cc5c50dd-3f64-4378-bd75-d42dacd4bcc5)
Route5ab73c82-8e9a-4cc3-84c8-3a1ffa695f11
Route Channelrup97m4qmbbgtnthbnahjndfnw

Bugs Found

BUG-AUTH-MIDDLEWARE (CRITICAL)
src/middleware/auth.js:39,49

Auth middleware uses .eq('id', user.id) to look up employees/clients, but table 'id' != auth.users.id. Should use .eq('authUUID', user.id). All authenticated API calls fail with 403 for any user where id != authUUID.

BUG-HISTORY-502 (HIGH)
src/modules/client-proxy/support-history.js:87

getPostsForChannel called with options object {per_page, before} but @mattermost/client Client4 expects positional args (channelId, page, perPage). Results in 502 for all history requests.

Back to index