Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

reversals: a rejected twin leaves the back-link on the original - it can never be reversed again (refuse cannot read the twin's status)

Aperta
#7,950 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
api, backend

Direzione di ricerca

Start with the refuse: parser and the checks: forbidWhen handling described in the issue, then trace how reversals: writes and restricts the ReversedBy back-link during a status transition. Reproduce the sequence in BusinessIntents/base-journal: post an entry, reverse it, reject the twin, and reverse again. Done means a rejected twin allows a new reversal while a posted twin still blocks one; the issue gives two possible approaches but does not identify relevant source files or tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens (14.93.0)

reversals: (#7886 / PR #7900) writes the back-link on the POSTED original in the same transaction as the twin, and the twin lands at the init status (DRAFT) with the entity's normal flow. When the accountant rejects that twin (its Post task -> CANCELLED), the original keeps ReversedBy pointing at a twin that reversed nothing:

  • the next Reverse is refused 409 by the authored refuse: { when: "ReversedBy != null" } - "This entry is already reversed";
  • the cancelled twin cannot be deleted either: This Journal Entry is referenced by 1 Journal Entry record(s) and cannot be deleted (the back-link restricts, #7657);
  • the original is POSTED, so immutableWhen keeps a user from clearing the link.

The entry can never be reversed again. Reproduced on dirigiblelabs/dirigible:14.93.0 with BusinessIntents/base-journal (reverseEntry on JournalEntry): post an entry, Reverse (200, twin DRAFT), reject the twin's Post task, Reverse again -> 409, DELETE the twin -> 409.

The natural guard, refuse: { when: ["ReversedBy != null", "ReversedBy.Status != 3"] }, is refused by the parser: each term is "<field or to-one of JournalEntry> ==|!= <value | null>" - refuse terms are record-local, while checks: forbidWhen reads one hop.

Ask (either is enough)
  1. Let refuse: terms read one to-one hop, like forbidWhen (ReversedBy.Status != CANCELLED); or
  2. treat a back-link whose twin stands in a declared terminal-without-effect status as absent, e.g. backLink: { name: ReversedBy, clearWhen: "Status == CANCELLED" } - clear the original's back-link when the twin enters that status (same transaction as the transition).
Acceptance

Reverse -> reject the twin -> Reverse again answers 200 and the back-link names the new twin; a posted twin still blocks a second Reverse.

Downstream: BusinessIntents/base-journal#74.

Lingua principale
Java
Stelle
278
Fork
97
Merge medio
18h 57m
PR unite (30g)
249

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-dirigible/dirigible

Tutte le issue di eclipse-dirigible/dirigible

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.