reversals: a rejected twin leaves the back-link on the original - it can never be reversed again (refuse cannot read the twin's status)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
immutableWhenkeeps 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)
- Let
refuse:terms read one to-one hop, likeforbidWhen(ReversedBy.Status != CANCELLED); or - 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.
- Dominant language
- Java
- Stars
- 278
- Forks
- 97
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 228
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-dirigible/dirigible
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
eclipse-dirigible/dirigible#7958 ·
Maintainers usually reply within 1 day
-
intent: a create-from without fromStatus answers 200 on a missing or unknown source id (no 400/404)Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-dirigible/dirigible#7945 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-dirigible/dirigible#7891 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-dirigible/dirigible#6538 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
eclipse-dirigible/dirigible#4812 ·
Maintainers usually reply within 1 day
All issues in eclipse-dirigible/dirigible
Similar issues
-
account bug communication lecture
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Consumer progress rows interleave topics with equal queue IDsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/rocketmq-dashboard#7250 ·
Maintainers usually reply within 3 days
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ignatov/intellij-erlang#1093 ·
-
[Bug] QoS count command ignores the times argument after cdPossibly taken @CCCLL claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/dubbo#16530 · 1 comment ·
Maintainers usually reply within 1 day