Terminplaner: veraltete G01 verworfen, Index bookingId
Eine G01, die erst nach holdMinutes + 1 Minute faellig wird, ist mit verfallenem Link nutzlos: sie wird nicht mehr gesendet, sondern verworfen (kein Transportaufruf, kein Budgetplatz, Felder geleert, kein Zustellfehler, raeumeAuf loescht sie nach 48 Stunden). Neuer Index idx_booking auf termineOutbox fuer zustellFehler und verwerfeWartende; verworfeneG01() zaehlt seit Prozessstart. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
36b94c3035
commit
43b3caddde
4 files changed
+268
-18
No files matched your search
@@ -156,7 +156,7 @@ test('Schema: Indizes wie in der Spezifikation und nur auf vorhandenen Attribute
|
||||
['idx_status_updated', 'status', 'updatedAt'],
|
||||
])
|
||||
assert.deepEqual(indexes('termineClaims'), [['idx_booking', 'bookingId'], ['idx_bis', 'bis']])
|
||||
assert.deepEqual(indexes('termineOutbox'), [['idx_status_next', 'status', 'naechsterVersuch']])
|
||||
assert.deepEqual(indexes('termineOutbox'), [['idx_status_next', 'status', 'naechsterVersuch'], ['idx_booking', 'bookingId']])
|
||||
for (const name of NAMES) {
|
||||
for (const index of TERMINE_COLLECTIONS[name].indexes) {
|
||||
assert.equal(index.type, 'key')
|
||||
@@ -295,6 +295,24 @@ test('main: eine vorhandene termineBookings-Collection bekommt nur die beiden Lo
|
||||
assert.deepEqual(client.calls.attrs.filter((k) => k.startsWith('termineBookings.')), [])
|
||||
})
|
||||
|
||||
test('main: legt idx_booking der Mail-Warteschlange an; eine vorhandene termineOutbox bekommt nur diesen Index nachgezogen (--check meldet ihn)', async () => {
|
||||
const voll = fakeClient()
|
||||
await main({ client: voll, log: quiet })
|
||||
assert.ok(voll.calls.indexes.includes('termineOutbox.idx_booking'))
|
||||
assert.ok(voll.calls.indexes.includes('termineOutbox.idx_status_next'))
|
||||
|
||||
const vorhanden = { termineOutbox: { attrs: keysOf('termineOutbox'), indexes: ['idx_status_next'] } }
|
||||
const lines = []
|
||||
const offen = await main({ check: true, client: fakeClient(vorhanden), log: (line) => lines.push(line) })
|
||||
assert.deepEqual(offen.missingIndexes.filter((i) => i.collection === 'termineOutbox').map((i) => i.key), ['idx_booking'])
|
||||
assert.ok(lines.some((line) => line.includes('Index termineOutbox.idx_booking FEHLT')))
|
||||
|
||||
const client = fakeClient(vorhanden)
|
||||
await main({ client, log: quiet })
|
||||
assert.deepEqual(client.calls.indexes.filter((k) => k.startsWith('termineOutbox.')), ['termineOutbox.idx_booking'])
|
||||
assert.deepEqual(client.calls.attrs.filter((k) => k.startsWith('termineOutbox.')), [])
|
||||
})
|
||||
|
||||
test('main --check legt nichts an und meldet Fehlendes', async () => {
|
||||
const client = fakeClient()
|
||||
const lines = []
|
||||
|
||||
Reference in new issue
Block a user