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

JsonPatchConflict error when duplicate identifier dicts exist #764

Closed
symroe opened this issue Jan 23, 2019 · 2 comments
Closed

JsonPatchConflict error when duplicate identifier dicts exist #764

symroe opened this issue Jan 23, 2019 · 2 comments

Comments

@symroe
Copy link
Member

symroe commented Jan 23, 2019

https://sentry.io/democracy-club-gp/ynr-v9/issues/840483333/?referrer=github_plugin

IndexError: list assignment index out of range
  File "site-packages/jsonpatch.py", line 402, in apply
    del subobj[part]

JsonPatchConflict: can't remove non-existent object '3'
(12 additional frame(s) were not displayed)
...
  File "candidates/models/needs_review.py", line 89, in needs_review_due_to_statement_edit
    for version_diff in la.person.version_diffs:
  File "people/models.py", line 457, in version_diffs
    return get_version_diffs(json.loads(versions))
  File "candidates/diffs.py", line 277, in get_version_diffs
    id_to_parent_ids[version_id], id_to_version
  File "candidates/diffs.py", line 276, in <listcomp>
    for parent_with_data in get_parents_version_data(
  File "candidates/diffs.py", line 222, in get_version_diff
    from_data = jsonpatch.apply_patch(from_data, [operation])

JsonPatchConflict: can't remove non-existent object '3'
@symroe
Copy link
Member Author

symroe commented Jan 23, 2019

This is a bug in JsonPatch that we'll have to work around until it's been fixed.

@symroe
Copy link
Member Author

symroe commented Jan 24, 2019

Fixed in #760

@symroe symroe closed this as completed Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant