Skip to content

Setting a belongsTo relationship does not clear the previous triple/relationship #38

@elpoelma

Description

@elpoelma

Describe the bug
When setting/overwriting a belongsTo relationship using the JSON:API, the previous triple/relationship doesn't always get cleared.

To Reproduce
Below are steps on how to reproduce this in GN, but it should also be easy to reproduce in any other app:

  • Check-out https://github.com/lblod/app-gelinkt-notuleren/tree/v5.37.1
  • Start the stack + ensure migrations have run
  • Open the frontend on port 80
  • Mock-login as any user
  • Open/create a meeting.
  • Add some agendapoints to that meeting
  • In section 3 of the meeting reorder/remove some agenda items:
    image
  • The above action ensures that some belongsTo relationships are overwritten, as each agenda-item has a relationship with the previous agendapoint in the list (using the vorigeAgendapunt relationship). It is this relationship that does not get correctly overwritten
  • Open the 'Sign and publish' screen and open the 'Planned agenda' section. Notice that a few agendapoints pop-up multiple times.

If I find the time, I'll create an easier reproduction of this issue.

Expected behavior
The vorigeAgendapunt relationship are correctly cleared when setting them.
In the 'Planned agenda' section, each agendapoint is only displayed once.

Notes
The regression/bug seems to have been introduced in 611482c

Versions/environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions