Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objects API - object_list data_attr exact match also matches against previous version of an object #260

Closed
alextreme opened this issue Nov 8, 2021 · 0 comments · Fixed by #266
Assignees
Labels
bug Something isn't working
Milestone

Comments

@alextreme
Copy link
Member

From Ritense, the following issue has been found. I've been able to reproduce it by using PUT against an existing object with a modified field and after that trying to match the old objects' contents.

We have object e89cca88-... with a status field:

GET https://objects-api/api/v2/objects?&page=1&type=https://objecttypes-api/api/v1/f972b43c-...&data_attrs=adresinformatie__status__exact__IN_SANERINGSPROJECT

"adresinformatie": {
                        "status": "IN_SANERINGSPROJECT",
                        "saneringsproject": {
                            "projectnaam": "Test 1",
                            "adresdossier": "d05d761d",
                            "projectnummer": "SP2021110801"
                        }
                    }

We modify the object to the new status:

PUT https://objects-api/api/v2/objects/e89cca88-...

...
"adresinformatie": {
                        "status": "NIET_GESELECTEERD",
                        "saneringsproject": {
                            "projectnaam": "Test 1",
                            "adresdossier": "d05d761d",
                            "projectnummer": "SP2021110801"
                        }
                    }

However when searching for the old status, this matches the modified object which isn't expected:

GET https://objects-api/api/v2/objects?&page=1&type=https://objecttypes-api/api/v1/f972b43c-...&data_attrs=adresinformatie__status__exact__IN_SANERINGSPROJECT

"adresinformatie": {
                        "status": "NIET_GESELECTEERD",
                        "saneringsproject": {
                            "projectnaam": "Test 1",
                            "adresdossier": "d05d761d",
                            "projectnummer": "SP2021110801"
                        }
                    }

The question then is how the API user can use object_list and ensure that only the objects with the status "IN_SANERINGSPROJECT" are found.

@joeribekker joeribekker added the bug Something isn't working label Nov 29, 2021
@joeribekker joeribekker added this to the Sprint #10 milestone Nov 29, 2021
SonnyBA added a commit that referenced this issue Jan 8, 2025
see #260/#259/#258 (dependabot alerts)
SonnyBA added a commit that referenced this issue Jan 8, 2025
see #260/#259/#258 (dependabot alerts)
SonnyBA added a commit that referenced this issue Jan 8, 2025
see #260/#259/#258 (dependabot alerts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants