fix(rust): the last fixes' small ones (W3 W6 W7/W11 W8 W10 W13-W18)
Stage 2 of PLAN_LAST_FIXES (docs#366). - W7/W11: an "is it loaded" refusal is confirmed live before it is given. New liveStatus.js asks the sidecar once (boot.refreshOne, as a poll tick would), at most once per server per 5 s and waiting at most 3 s, then reads the stored status again. Used by Economics (step and staff page), Backpacks, Dangerous Treasures, Guarded Crate, RaidableBases, ZoneDomes, TruePVE and RunicNPC. - W3: a world call answered `already-out` (the bridge half comes in stage 3) succeeds as called 0, saying a Travelling Vendor is already out. - W6: "A locked crate dropped by a Chinook is being hacked." - W8: a RaidableBases profile's audit row names RaidableBases, not "@data". - W10: the backpack sizes picker lists each size once, naming its servers. - W13: a RaidableBases name both servers describe differently shows each server's own description. - W14: each RaidableBases note after the first starts its own sentence. - W15: a staff deposit refused at Economics' limit answers 409. - W16: a payment's failedNote explains only the reasons that happened. - W17: the sync state counts player grants that did not land (waitingToLand), and the Permissions page says "in sync · 1 waits for their player to join" instead of plain "in sync". - W18: Guarded Crate's kept note drops the "30 minutes" it could not know. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -39,6 +39,10 @@ function withRecorder(rows = []) {
|
||||
|
||||
withRecorder()
|
||||
|
||||
// The stored status is the whole answer in these tests: nothing asks a
|
||||
// sidecar before a refusal (W7, W11). liveStatus.test.js covers the ask.
|
||||
require('../liveStatus').refresh = async () => false
|
||||
|
||||
const rb = require('../raidableBases')
|
||||
const catalogue = require('../catalogue')
|
||||
const { gridOf } = require('../worldEvents')
|
||||
@@ -237,6 +241,22 @@ test('the pickers list each server’s own names, once each, and nothing for a s
|
||||
assert.deepStrictEqual(await difficulties.resolve(), [], 'nothing is made up for a server without the plugin')
|
||||
})
|
||||
|
||||
test('a name both servers have, described differently, shows each server’s own description (W13)', async (t) => {
|
||||
const [difficulties, profiles] = module_().OPTION_SOURCES
|
||||
const hard = (difficulty) => ({ ...REPORT, profiles: [{ name: 'Hard Bases', difficulty, level: 2, enabled: true, pvp: true, bases: ['h1'], seabed: false, float: false }] })
|
||||
stubStep(t, {
|
||||
reports: {
|
||||
main: { raidableBases: hard('Hard') },
|
||||
pve: { raidableBases: { ...hard('Expert'), difficulties: [{ name: 'Gentle', level: 1 }, { name: 'Wobbly', level: 7 }] } },
|
||||
},
|
||||
})
|
||||
assert.deepStrictEqual(await profiles.resolve(), [{ value: 'Hard Bases', label: 'Hard Bases · Hard — Main; Hard Bases · Expert — PvE' }])
|
||||
assert.deepStrictEqual(await difficulties.resolve(), [
|
||||
{ value: 'Gentle', label: 'Gentle (level 0) — Main; Gentle (level 1) — PvE' },
|
||||
{ value: 'Wobbly', label: 'Wobbly (level 7) — Main, PvE' },
|
||||
])
|
||||
})
|
||||
|
||||
test('without a patched helper, a spot, a profile, a base or settings are refused; a plain spawn is not (D348, D387)', async (t) => {
|
||||
const run = (params) => spawnStep().perform({ runId: 7, idempotencyKey: '7:1', params: { server: 'main', ...params }, verify: true })
|
||||
stubStep(t, { reports: { main: { raidableBases: { ...REPORT, helper: { state: 'missing' }, profiles: null }, console: { plugins: true } } } })
|
||||
@@ -337,8 +357,12 @@ test('a base the helper did not make is not the run’s: no resource, and the ru
|
||||
const result = await spawnStep().perform({ runId: 7, idempotencyKey: '7:1', params: { server: 'main', difficulty: 'Wobbly' } })
|
||||
assert.ok(result.ok)
|
||||
assert.strictEqual(result.resources, undefined)
|
||||
assert.match(result.detail.note, /RaidableBases picks the spot/)
|
||||
assert.match(result.detail.note, new RegExp(module_().OWN_TIMER))
|
||||
const own = module_().OWN_TIMER
|
||||
assert.strictEqual(
|
||||
result.detail.note,
|
||||
`RaidableBases picks the spot; the map shows it once the base opens. ${own[0].toUpperCase()}${own.slice(1)}`,
|
||||
'each note after the first starts its own sentence (W14)',
|
||||
)
|
||||
})
|
||||
|
||||
test('the grid’s wait is a ten-minute retry; a refusal the plugin would repeat is not retried', async (t) => {
|
||||
|
||||
Reference in New Issue
Block a user