Docs/Feedback.md

Feedback: the players tell the team what they see

From the game's menu, a player sends the team a picture of their view, a sentence (typed, or said into the microphone: the local dictation) and where they are (position, where they look, build, VR or desktop, the menu open). The team reads them on the Monitor; the orchestrator's scripts read them through the admin API (Docs/Fleet.md).

Today it is on for the dev and staging servers (the ApiServer's Feedback:Enabled, which the client reads at /api/feedback/status to show its button or not). It is meant to open to every player later: it is rate-limited per account from the start (FeedbackRoutes.PerHour), and the picture is small (JPEG, at most MaxImageSide pixels).

The contract, shared by the client and the servers: Libs/Shared.Contracts/FeedbackApi.cs (FeedbackRoutes, FeedbackDto, FeedbackItemDto). Adding the call raised ProtocolVersion.Current to 67.

Servers

The ApiServer (Apps/ApiServer/Feedback.cs) has the four routes of FeedbackRoutes:

Route Who What
GET /api/feedback/status anyone, no token { enabled }: the switch Feedback:Enabled (env Feedback__Enabled)
POST /api/feedback the character's token (Authorization: Bearer, the one of /api/characters/{id}/play; the account's token is refused, 401) 403 when the switch is off; 400 FeedbackRoutes.Validate's reason, or a picture that is not base64, not a JPEG (its start FF D8 FF and end FF D9 markers) or over MaxImageBytes once decoded; 429 more than PerHour (20) this hour for the account; 200 FeedbackSentDto (its number)
GET /api/admin/feedback?take=N X-Admin-Key the latest N (default 50, at most 1000), newest first, without their pictures (FeedbackItemDto)
GET /api/admin/feedback/{id}/image X-Admin-Key the picture, image/jpeg; 404 when it has none

A wrong or missing X-Admin-Key is 401 (compared in constant time). The key is the ADMIN_KEY secret, the Orchestrator's (AdminKey in the ApiServer's configuration; dev-admin-key on a developer's machine, refused with NOF_PRODUCTION, see Security.md).

The switch. Off when nothing sets it; docker-compose.yml sets it from FEEDBACK_ENABLED (default true: the dev and staging servers take feedback) and Tools/Dev/Start-Dev.ps1 turns it on for the local backend. A server that takes none: FEEDBACK_ENABLED=false in its .env. It is read at each call.

Where it is kept. The ApiServer checks a feedback, finds its character from the token, decodes the picture and gives it to the DbWorker (Apps/DbWorker/FeedbackEndpoints.cs, the only service talking to PostgreSQL), whose internal routes (X-Worker-Key, Libs/Shared.Contracts/FeedbackDbApi.cs, FeedbackDbRoutes) are: POST /db/feedback (FeedbackDbRequest: 200 its number, 409 too many this hour, which the ApiServer turns into 429), GET /db/feedback?take=N, GET /db/feedback/{id}/image, POST /db/feedback/{id}/handled. The table Feedback (migration Feedback): when, the account, the character (its id and name then), the text, the picture (bytea, null: none), build, profile, VR, x, y, z, yaw, context, and handled (set by the team). The rate per account and hour is counted there (FeedbackRoutes.PerHour, as the players' reports count theirs).

Reading them. The Monitor's Feedback page (Monitor.md): newest first, the picture as a thumbnail that opens full size, the text, the character, build, profile, VR or desktop, position, context, time, and Handled / Reopen. Scripts (the orchestrator's, Fleet.md) use the admin API:

curl -H "X-Admin-Key: $ADMIN_KEY" https://<server>/api/admin/feedback?take=20
curl -H "X-Admin-Key: $ADMIN_KEY" -o 12.jpg https://<server>/api/admin/feedback/12/image

Tested in Tests/Api.Tests/FeedbackTests.cs (the switch, the checks, the 429, the admin key).

Client

The button. Bug (German Fehler; its screen is titled Report a bug, French Reporter un bug, not Signaler: that one reports a player; a longer label cut the gold beside it) is in the in-game menu's session bar, beside Leave (GameMenuVr.Session.cs): on every tab, always at hand, and never in the way of a tab's own buttons. It shows only when the server said it takes feedback: the client asks FeedbackRoutes.Status each time it enters the game (GameMenuController.CheckFeedback); no answer, an error or an older server without the route (404) keep it hidden.

The report opens at once (2026-11-29, the owner's second test: a picture is not always wanted, and one line was too short): the bar's Bug puts the report's screen in place of the whole menu (GameMenuVr.Feedback.cs, a UiScreen of the kit), with a hint, the button Picture, the text and its keyboard, Cancel and Send:

 +---------------- Report a bug ----------------+
 | [ picture ]  Say what is wrong...            |
 |  [ Picture ] [ Remove the picture ]          |
 | [ text, five lines, then smaller, scrolls  ] |
 |   [ the keyboard, with its microphone key ]  |
 |            [ Cancel ]  [ Send ]              |
 +----------------------------------------------+

The text has several lines (a UiTextArea of the kit, up to MaxText = 1000 characters): typed on the UiVirtualKeyboard, Enter starts a line (Send is its own button), or said with its microphone key (the local dictation of the Players tab's report, Dictation / WhisperSpeech, added at the end). The box holds 5 lines at the body's size; a longer text gets smaller (down to the body's minimum, still easy to read at arm's length), then scrolls by line: drag it, the right stick, the wheel, its scroll bar on the right (shown when the text is longer than the box). Typing or dictating brings the view back to the end, where one writes (see UiTextArea in UiKit.md).

The picture is optional. Picture puts the report aside, its text kept (SuspendFeedback), and shows the menu again as it was, while a countdown runs (FeedbackForm.CountdownSeconds, 5 s; "Picture in 5…", low on the right of the view, held on the eyes' camera so it is read with the menu open or closed: FeedbackCapture.ShowCountdown): time to show a tab, close the menu, look at the place. Then what the player sees is taken, the menu included when it is open (only the lasers and the countdown are hidden for that frame), and the report comes back with it (ResumeFeedback; the menu opens again if it was closed). Picture becomes Take it again, and Remove the picture drops it. Closing the menu during the countdown does not drop the report (OnHidden keeps a report put aside); leaving the game does. The picture (FeedbackCapture):

  • on a desktop, the game's window as drawn (two frames later);
  • in VR, the headset's view drawn once more from the eyes into a 1600 × 900 picture of its own (a SubViewport on the same world, through the eyes' camera's layers and environment, 70° high, like the stream camera), since the headset's own image is one square-ish eye per layer.

It is scaled down to at most MaxImageSide on its largest side (FeedbackForm.Fit) and encoded as JPEG at 80 % (Image.SaveJpgToBuffer, off the main thread): about 100 KB for a 1280 × 720 window.

Send needs a text or a picture (FeedbackForm.CanSend). Then the status line says Sending…, and:

  • kept: "Sent, thanks: #12" (the number the server gave), Send, the picture's buttons and the keyboard gone, Cancel becomes Close;
  • refused or not reached: why (FeedbackForm.Failure: the server's reason for a 400, "this server takes no bug reports now" for a 403, "at most 20 an hour" for a 429, "the server did not answer", or the error's status), Send becomes Try again with the same text and picture. A send that timed out is not retried by itself (it may have been kept: two reports).

Cancel drops the report and any dictation going on.

What is sent (FeedbackForm.Build, ApiClient.SendFeedbackAsync with the character's token): the text (trimmed), the picture in base64 (none: null), Build (build.json's build, "source" from the repository), Profile (build.json's optional "profile", the staging install's, written by Publish-Client.ps1 -Profile staging, see The staging install in Fleet.md; "" when none), VR or desktop, the feet in game coordinates (IPlayerRig.Feet, never a scene position: see Floating origin in Architecture.md) and where the player looked (degrees, 0..360), and the context: the menu tab open (menu=closed when it was closed), then the biome under the feet or dungeon (tab=Map; biome=Forest). Place, look and context are the picture's when there is one, else those of the moment Bug was pressed.

Test hook: --feedback-preview [open|sent|failed|bar] (with --vr-menu-preview --screenshot PATH --wait 14, no server asked): the menu opens, its Bug is pressed 1.5 s later and a text of twelve lines typed (smaller, scrolled to its end); open stops there (the report as it opens); otherwise its Picture is taken after the countdown (the hook starts that much earlier, so the screenshot shows the report back with it), then sent shows it as kept (#12), failed as refused (too many this hour); bar only shows the button in the bar. Tests: Tests/Shared.Tests/FeedbackFormTests.cs (the picture's size, the DTO, the texts) and ApiClientTests.cs (the two calls against a stub server: the route, the token, the JSON, 200 / 400 / 403 / 429 / 500 / not reached).