YANG QIA 30b6a1398c fix(knowledge): guard proposal revisions by access, a unique open key and migration order
- A revision replaces only the proposal sent back from the same source for the
  same target (the document, or a new document's space, parent and slug); a
  replacesId naming any other, or none, is refused alike with
  KNOWLEDGE_PROPOSAL_NOT_REVISING. A proposal shows the one it replaced, the one
  that superseded it, and a conflict's proposalId only to whoever may read that
  one, checked on every read.
- kbProposals.openKey, unique and non-null, holds a hash of target and source
  while a proposal is pending or sent back and its id once closed, so concurrent
  propose/requestDocChanges cannot open two; the loser gets 409
  KNOWLEDGE_PROPOSAL_PENDING with nothing written and no event, and any other
  database error passes through.
- Renumber the unmerged migration to 202610240040_kb_proposals_add_revisions,
  after every migration on v3-develop, and add the key there; pending proposals
  that already share a target and source all stay pending, the oldest holding
  the key.
2026-10-12 22:41:51 +08:00
2026-08-17 09:01:50 +08:00
Languages
TypeScript 99.1%
JavaScript 0.8%