fix(rust): send reward notices, and keep a downed line's credit rule (W21, W4) #54

Merged
whitlocktech merged 1 commits from fix/last-fixes-bugs into edge 2026-10-21 07:00:35 -05:00
Member

What & why

Stage 1 of docs/modules/rust/PLAN_LAST_FIXES.md (docs#366): the two real bugs.

  • W21: a reward's message never reached the game. permSync.js listed the push's fields one by one and left out notices, so no kit reward, lend or give has ever told its player anything (D333). The body is now built by a new pushBody(), which sends notices. A test fails if any field the model builds is missing from the push.
  • W4: the feed re-credited past helicopter and Bradley lines with the server's current credit rule, while the Rotorbane/Tankbreaker counts kept the old one. Ingest now stamps the rule in force onto a downed patrol helicopter, Chinook or Bradley frame before it is stored (worldEvents.stampRule). The feed reads that stamp (worldEvents.ruleOf) and falls back to the server's rule for rows stored before this fix, so those rows read the way they do today. Ingest counts by the same stamped rule.
  • The public feed's OpenAPI description now says a line keeps the rule that was in force when it arrived. swagger-fragment.json is regenerated.

The docs changes (the PLAN_LAST_FIXES status and the rest) come in stage 5, as the plan says.

How it was tested

  • npm test: 693/693 pass. check:imports, check:swagger and check:engagement are clean.
  • New tests: the push carries notices and every other payload field (stepEditor.test.js). A downed frame is stored with its rule and an arrival is stored as sent. A stored line keeps its rule after the server's rule changes (worldEvents.test.js).
  • Walk-site check (:3270, DB rustwalk, this branch loaded into the walk copy of the module):
    • W4: I set the Oxide rig's rule to most, spawned a patrol helicopter and downed it with the RgWalk stand-ins (Bob dealt the most damage, Alice the crippling hit). The line read rule most, credited BobWalk, and the stored row carries creditRule: "most". I switched the server to blow and the same line still read BobWalk, the player the count went to. Older rows have no stamp.
    • W21: I put a logging proxy in front of the Oxide sidecar and ran a rust.perm.lend with a chat message to every linked player (run 77). The next /permissions/sync carried fields=setId,groups,grants,credits,notices,retire, with run 77's message for player A among the notices. A was offline, so noticesTold=[]. Telling a player on waking was walked in game at PLAYER_WALK 2.9 on 2026-10-21, with the same fix patched in. The server row is back on its real sidecar URL and the rule is back to blow.

Checklist

  • I have read CONTRIBUTING.md.
  • The change builds and existing tests/checks pass locally.
  • I have added or updated tests/docs where it makes sense.
  • My commits are reasonably scoped with clear messages.

AI-assisted contributions (required)

  • No AI tools were used to produce this contribution.
  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a Co-Authored-By / Assisted-By trailer.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

## What & why Stage 1 of [`docs/modules/rust/PLAN_LAST_FIXES.md`](https://gitea.whitlocktech.com/RunicGateway/docs/src/branch/main/modules/rust/PLAN_LAST_FIXES.md) (docs#366): the two real bugs. - **W21: a reward's message never reached the game.** `permSync.js` listed the push's fields one by one and left out `notices`, so no kit reward, lend or give has ever told its player anything (D333). The body is now built by a new `pushBody()`, which sends `notices`. A test fails if any field the model builds is missing from the push. - **W4: the feed re-credited past helicopter and Bradley lines with the server's current credit rule, while the Rotorbane/Tankbreaker counts kept the old one.** Ingest now stamps the rule in force onto a downed patrol helicopter, Chinook or Bradley frame before it is stored (`worldEvents.stampRule`). The feed reads that stamp (`worldEvents.ruleOf`) and falls back to the server's rule for rows stored before this fix, so those rows read the way they do today. Ingest counts by the same stamped rule. - The public feed's OpenAPI description now says a line keeps the rule that was in force when it arrived. `swagger-fragment.json` is regenerated. The docs changes (the PLAN_LAST_FIXES status and the rest) come in stage 5, as the plan says. ## How it was tested - `npm test`: 693/693 pass. `check:imports`, `check:swagger` and `check:engagement` are clean. - New tests: the push carries `notices` and every other payload field (`stepEditor.test.js`). A downed frame is stored with its rule and an arrival is stored as sent. A stored line keeps its rule after the server's rule changes (`worldEvents.test.js`). - **Walk-site check** (`:3270`, DB `rustwalk`, this branch loaded into the walk copy of the module): - **W4:** I set the Oxide rig's rule to `most`, spawned a patrol helicopter and downed it with the RgWalk stand-ins (Bob dealt the most damage, Alice the crippling hit). The line read `rule most, credited BobWalk`, and the stored row carries `creditRule: "most"`. I switched the server to `blow` and the same line still read BobWalk, the player the count went to. Older rows have no stamp. - **W21:** I put a logging proxy in front of the Oxide sidecar and ran a `rust.perm.lend` with a chat message to every linked player (run 77). The next `/permissions/sync` carried `fields=setId,groups,grants,credits,notices,retire`, with run 77's message for player A among the `notices`. A was offline, so `noticesTold=[]`. Telling a player on waking was walked in game at PLAYER_WALK 2.9 on 2026-10-21, with the same fix patched in. The server row is back on its real sidecar URL and the rule is back to `blow`. ## Checklist - [x] I have read [CONTRIBUTING.md](CONTRIBUTING.md). - [x] The change builds and existing tests/checks pass locally. - [x] I have added or updated tests/docs where it makes sense. - [x] My commits are reasonably scoped with clear messages. ## AI-assisted contributions (required) - [ ] No AI tools were used to produce this contribution. - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` / `Assisted-By` trailer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-10-21 06:24:58 -05:00
fix(rust): send reward notices, and keep a downed line's credit rule (W21, W4)
All checks were successful
PR Checks / client-build (pull_request) Successful in 21s
PR Checks / frozen-manifest (pull_request) Successful in 48s
PR Checks / server-tests (pull_request) Successful in 7m16s
8aff9b33a6
W21: the permission push named its fields one by one and left out
`notices`, so no kit reward, lend or give ever told its player
anything (D333). The body is now built by `pushBody`, which carries
every field the payload has; a test fails if a payload field is
dropped again.

W4: a downed patrol helicopter, Chinook or Bradley is stored with the
credit rule in force when it arrived, and the feed reads that stamp.
Before, the line re-credited past rows with the server's current rule
while the Rotorbane/Tankbreaker counts kept the old one. Rows stored
before this change keep today's reading.

PLAN_LAST_FIXES.md stage 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech merged commit d69c2108c6 into edge 2026-10-21 07:00:35 -05:00
whitlocktech deleted branch fix/last-fixes-bugs 2026-10-21 07:00:36 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Module-Rust#54
No description provided.