Commit Graph
19 Commits
Author SHA1 Message Date
Lauri Ojansivu 5e671c7034 Scrum: batch undo and redo of a large sprint is 2.6 times faster.
Undoing a 10,500-card sprint close took 282 s and redoing it 578 s, about
27 ms a card: each record of a History row cost some thirty database
round trips - a read per record in the preflight, two ownership checks
(two reads each) around every read, the same again around a readback
after every write, and the whole row read back record by record twice
more at the end.

Now a row's records are read in one query per type (readTargets), and
inspectScrumHistoryWrites takes that as readMany, bracketed by one
ownership check before and one after: the worker's claim and the source
row only ever go from current to displaced, so current before and after
the read means current throughout it. Every write keeps its ownership
check right before it, after the read it is computed from; the readback
after a write confirms the value landed and leaves ownership to the next
write's fence and the batch's final readback. A sprint or release that
thousands of cards name is looked up once, not once a card. The
permission check stays per card.

The 10,500-card start / close / undo / redo test went from 14 min 27 s
to 6 min 7 s on the same machine; all 18 Scrum tests pass.
tests/scrumHistoryWriteState.test.cjs pins one read and three checks
for a bracketed read, ownership lost during it, a short answer, a missing
record and identities checked before any read (negative), and that every
write in the path is still fenced after its read.

Thanks to xet7 !
2026-10-14 21:45:54 +03:00
Lauri Ojansivu 9ad9813c09 Let a board admin resolve a Scrum undo or redo that stopped on a conflict.
A Scrum History undo, redo or restore keeps a checkpoint that blocks every
Scrum edit on its board until it finishes, and only its author could retry
it, with the same plan. When somebody else had changed one of its records,
its History row changed or its author lost write access, every retry failed
the same way, the checkpoint could not be discarded online or offline, and
the board's Scrum edits stayed blocked for good.

A retry that fails for a reason the next one would meet again now marks its
checkpoint. A board administrator sees such a checkpoint in the History
recovery notice and can roll it back, which restores every record it wrote
to the saved "before" value and revision and is offered only when nobody
changed those records since and none of its History was written, or keep the
board as it is, which removes the checkpoint and writes nothing while
reporting how much of the operation had been written. A checkpoint that has
not stopped on a conflict stays its author's to retry. The resolution names
the checkpoint it resolves, so a repeat is a no-op; it claims the checkpoint
by compare-and-set, fencing the author's workers, waits for an in-flight
write, and checks every record before and after its own writes. Each one is
recorded in Admin Panel / Problems / Recovery. The offline command
releases/recover-scrum-history.cjs does the same with every writer stopped.

Unit, integration (against MongoDB 7), Meteor and Playwright tests cover
rollback, discard, refusals, concurrency and the offline command. New text
is in English, pending Transifex.

Thanks to xet7 !
2026-10-08 12:06:49 +03:00
Lauri Ojansivu 727ceedd01 Let a card be in more than one release.
A card had exactly one release, scrum.releaseId. Jira import kept only the
first fix version of an issue and reported the rest as lost, Jira export
wrote no fix versions at all, and the card UI could not show or pick more
than one release.

A card's releases are now a list, scrum.releaseIds, with releaseId kept as
its first entry so older servers, importers and REST readers still see one.
Existing cards are not migrated: every reader goes through cardReleaseIds(),
which reads the list and the old single field the same way, so cards saved
either way work side by side, and a card moves to the new form on its next
Scrum save. A save with releaseIds replaces the list; a save with only
releaseId, from an older client, replaces the first release and keeps the
others, and null clears them. Every release must belong to the board,
checked in one query; duplicates collapse and a releaseId that contradicts
the list is refused.

Copies and moves to another board link each release by name. The native
transfer writes one release exactly as before and adds releaseIds only for
cards with several, and remaps each of them on import. Jira import maps every
fix version and Jira export writes them all as fixVersions. Board View /
Sprints shows each release's cards and how many are done, counting a card in
each of its releases. Scrum History checks and guards every release, and
rule e-mails name them all. The Product Backlog and card details use a
multiple select.

tests/scrumMultipleReleases.test.cjs covers the rules and fails if any code
reads the single field directly; a Playwright spec drives the UI. New text is
in English, pending Transifex.

Thanks to xet7 !
2026-10-08 11:51:44 +03:00
Lauri Ojansivu 600fc3b4de Close and undo very large sprints in the background, with progress in the Scrum view.
As decided on 2026-10-03, every per-card guard stays, and the browser
never waits on one call for the whole of a large sprint:

- A close of more than one chunk (2,000 cards) returns once the sprint is
  closed and its plan stored; its rollover continues in the background,
  chunk by chunk under the board's lock, recorded under the close's named
  History batch. Its progress is on the sprint, a failure is kept there for
  the Scrum view's resume button, and a restart resumes it. A smaller
  sprint is still closed and rolled over in one History row in the call.
- An undo or redo whose batch has more than four rows left applies the
  first row in the call and the rest as a background job (scrumBatchJobs),
  as the user who asked and with the same derived request IDs, so a retry
  or a restart resumes it. Undo and redo on that board wait for it.
- The Scrum view shows both as progress bars and polls quietly while one
  runs.

The board-copy, native-import and Scrum menu specs read snapshot rows
through a helper now that they live outside the sprint, and the sprint
report's chart is no longer counted together with the daily and
change-by-change charts below it, which loaded in WebKit first.

Thanks to xet7 !
2026-10-03 09:31:44 +03:00
Lauri Ojansivu 13c8d563ea Lift the sprint card cap: chunked rollover plans and History, daily rows.
A sprint over 10,000 cards was refused at start and close. With the
snapshot rows already outside the sprint document, the rest now is too:

- The rollover plan of a close goes to its own collection,
  scrumRolloverRows, in chunks bounded by rows and bytes; the sprint keeps
  only rolloverPending: true. A chunk is applied, its cards read at once,
  and removed; the mark is cleared when none is left. A plan kept in the
  sprint document before this is still finished as it was.
- A Scrum History batch too large for one row is recorded as several rows
  sharing a batchId, each at most 1,000 records and 3 MB a side. A record
  is in exactly one row, and undo and redo walk the whole batch, with or
  without a request ID, so one undo still reverses a whole close.
- Daily burndown observations keep their rows in scrumSnapshotRows too.
- No 10,000-card limit is left: snapshot inputs, daily capture, scope
  replay, the daily report and the transfer read every card.

Undoing a batch re-hashed its whole History row and sent its whole plan as
a selector before every record write, so a 1,500-card undo took four
minutes. The row is now checked whole when the operation begins and by
its identity fields after that, and the worker check uses the plan's
identity and the worker's random id - nothing ever rewrites a pending
plan. A 10,500-card sprint closes in 8 s and undoes in 44 s.

Thanks to xet7 !
2026-10-03 01:47:19 +03:00
Lauri Ojansivu 20275418d4 Tell a recreated Scrum record from the one History planned against.
Scrum History judged "the record has the expected values and revision"
as proof of which record it was. One deleted and recreated under the
same _id - a restore by someone else - passed that test, so a retried
undo could delete a record from another lifetime. Maintainer decision
of 2026-09-30: every Scrum sprint, release and event now carries a
random incarnation per lifetime, set where it is created (the Scrum
methods, a board transfer import's plan, and a Scrum History restore).
A new checkpoint records the incarnation each target has and, for a
record it creates, the one it will have, chosen before writing so a
replay recognizes its own insert; the write-state check refuses any
other lifetime. History content never carries an incarnation, so a
restore always starts a new lifetime, and an update never unsets it.
Checkpoints and records from before incarnations keep working as they
did, and their completion identity is unchanged.

Unit tests cover every state with and without incarnations and the
planned lifetimes; a full-app test creates, undoes and redoes a sprint,
then replaces it with an identical record of another lifetime mid-undo:
the retry refuses and leaves it, where the previous code deleted it.
562 server tests pass.

Thanks to xet7 !
2026-09-30 10:20:20 +03:00
Lauri Ojansivu bfe4cc73b1 Serialize workers resuming the same Scrum History operation.
The board lock in server/scrum.js is a per-process queue, so two server
processes could resume one Scrum History operation at the same time and
interleave its writes; the checkpoint only proved the plan was the same,
not who was running it. Each resume now claims the checkpoint with its
own worker id after adopting the operation id. The newest claim wins,
and every guard between writes checks the claim, so a displaced worker
stops at its next guard instead of writing on. The worker id is kept out
of the plan selector, so completion hashes are unchanged, and a claim
never attaches to a replaced plan or a checkpoint without an operation id.

Unit tests cover newest-wins, displacement, a lost claim reply and a
replaced plan; a MongoDB test with two clients shows the older process
refused after the newer claim. 561 server tests pass.

Thanks to xet7 !
2026-09-30 02:46:30 +03:00
Lauri Ojansivu 6b44f61b2a Bind keyed Scrum undo and redo to their original selection
Accept optional caller-persisted request IDs in the History methods. Store immutable selections before mutation and reconcile completed requests without advancing the stack again. Keep empty and unsupported results stable; require fresh access and retain conflicting or missing recovery evidence.

Verify selection races, lost cleanup, concurrent redo, browser reload and private storage with Node, MongoDB, full-app and Chromium coverage. Keyboard request persistence, non-Scrum replay and shared writer coordination remain unfinished.

Thanks to xet7 !
2026-09-28 23:43:32 +03:00
Lauri Ojansivu 16b17c4943 Persist Scrum History completion before checkpoint cleanup
Bind immutable private receipts to the original operation, actor, source hash and checkpoint plan. Reconcile uncertain cleanup from saved completion without rewriting History or deleting successor work. Reject damaged evidence and changed plans.

Cover false and lost acknowledgements, restart replay, finalization corruption and browser privacy with Node, MongoDB, full-app and Chromium tests. Public request identities and cross-document coordination remain unfinished.

Thanks to xet7 !
2026-09-28 23:33:45 +03:00
Lauri Ojansivu 46d2039b8a Preflight complete Scrum recovery batches before resuming writes 2026-09-28 17:17:05 +03:00
Lauri Ojansivu bf75fafdd3 Fence Scrum restoration writes with captured placement and content 2026-09-28 17:13:49 +03:00
Lauri Ojansivu 62f5a48740 Confirm persisted Scrum restoration targets before completing recovery 2026-09-28 17:10:11 +03:00
Lauri Ojansivu a0f84ac115 Require expected revisions before acknowledging restored Scrum values 2026-09-28 17:06:08 +03:00
Lauri Ojansivu eb91a68a5a Bind Scrum recovery ownership to the exact persisted checkpoint plan 2026-09-28 17:02:33 +03:00
Lauri Ojansivu 2bbc13456f Refuse superseded Scrum redo checkpoints before replaying writes 2026-09-28 16:59:05 +03:00
Lauri Ojansivu 0d582c9c0a Verify Scrum undo finalization before removing recovery checkpoints
Check source integrity, conditional write results and persisted undo state. Preserve undo timestamps across retries and delete only the matching operation checkpoint. Test failed writes, damaged final state, replacement checkpoints and recovery in Node and Chromium.

Thanks to xet7 !
2026-09-28 01:07:15 +03:00
Lauri Ojansivu 484bad1d97 Acknowledge exact Scrum restoration History events on retry
Use deterministic event IDs and verify immutable contents and integrity before clearing recovery evidence. Accept exact legacy rows and lost insert acknowledgements; retain checkpoints on failed or conflicting records. Cover replay, concurrency, failed writes and damaged recovery rows in Node and Chromium.

Thanks to xet7 !
2026-09-28 01:03:10 +03:00
Lauri Ojansivu 8cb463722a Exclude marked incomplete Scrum imports from edits and reports
Reject Scrum mutations and History changes until imported data is complete. Remove editing capabilities, show the pending warning and return a clear 409 for report downloads. Verify exclusion and normal access after the importer clears its marker.

Thanks to xet7 !
2026-09-27 22:37:26 +03:00
Lauri Ojansivu ceb19bc77c Integrate Scrum changes with recoverable History undo and redo
Record compound sprint transitions in existing board History, preserve unrelated card data and enforce current per-item permissions. Keep recovery checkpoints until timeline and undo status are finalized.

Thanks to xet7 !
2026-09-27 17:55:31 +03:00