Reset a change to an object the same session deletes to NULL

Open
#1,987 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java, sql
Domain
databases

Research direction

The behavior is a data property change being reset to NULL when the object it points to is deleted in the same session; the payload names no source files. Start from the lsFusion LSF example in the issue body to reproduce the status(t) case, then look for the session change-handling code in the Java platform sources that decides which saved value a property falls back to on DELETE. Done means the example yields status(t) = NULL for the reset case while the dropValueChangesBackwardCompatibility setting restores the old result.

Written by the indexing model from the issue text.

Description

Description

When an object is deleted, a data property whose value it was reads NULL. A change of the property made in the same session to that object was dropped instead, and the property read its saved value again:

CLASS Status;
CLASS Task;
status = DATA Status (Task);

// t is saved with the status s, x is another status
status(t) <- x;
DELETE x;
// was: status(t) = s, nothing changed; now: status(t) = NULL, as for a task saved with x

Such a change is now reset to NULL as well. An application can notice it only where the saved value of the property is another object: a NONULL property fails the apply as not set, an object with a NONULL DELETE property moved under the deleted object is deleted with it, events and constraints on CHANGED / DROPPED of the property fire, forms show no value. The previous behavior is available with the dropValueChangesBackwardCompatibility setting.

Reason

Reading the saved value again was no undo of the change: the session's earlier changes of the property were lost with it (status(t) <- NULL; status(t) <- x; DELETE x; brought the saved status back), a NONULL property passed with a value nobody chose, and a form kept showing the saved option after the picked one was deleted.

Dominant language
Java
Stars
214
Forks
46
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lsfusion/platform

All issues in lsfusion/platform

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.