Skip to content

Fix geographic filter causing false-by-1 count of deleted objects#5202

Draft
marcantoinedupre wants to merge 1 commit intomasterfrom
fix-geographic-filter-causing-false-deleted-count
Draft

Fix geographic filter causing false-by-1 count of deleted objects#5202
marcantoinedupre wants to merge 1 commit intomasterfrom
fix-geographic-filter-causing-false-deleted-count

Conversation

@marcantoinedupre
Copy link
Copy Markdown
Contributor

@marcantoinedupre marcantoinedupre commented Jan 9, 2026

Le filtre géographique de Parser basé sur intersection_geom ajoutait None à self.to_delete dans le cas d'un nouvel objet (car self.obj.pk vaut None tant que l'objet n'a pas été saved, ce qui intervient plus tard dans le processus d'import).

En conséquence le compte d'objets supprimés dans le rapport d'import pouvait être faux de +1 si un ou plusieurs nouveaux objets se trouvant en-dehors de intersection_geom avaient été parsés.

En particulier la sortie d'un import avec un parser n'ayant pas encore été exécuté indiquait toujours « Enregistrement supprimé : 1 » ce qui est impossible.

Related Issue

Checklist

  • I have followed the guidelines in our Contributing document
  • My code respects the Definition of done available in the Development section of the documentation
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes
  • I added an entry in the changelog file
  • My commits are all using prefix convention (emoji + tag name) and references associated issues
  • I added a label to the PR corresponding to the perimeter of my contribution
  • The title of my PR mentionned the issue associated

When applied on a new (not saved yet) object the geographic filter caused None to be added to `self.to_delete`. As a consequence import's report count of deleted records would be off by 1. In particular it would always show 1 deleted recording even for a parser running for the 1st time (where a deleted recording is unexpected).
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (5f8c704) to head (39fb272).
⚠️ Report is 236 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #5202    +/-   ##
========================================
  Coverage   98.47%   98.47%            
========================================
  Files         272      272            
  Lines       22271    22390   +119     
========================================
+ Hits        21931    22049   +118     
- Misses        340      341     +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link
Copy Markdown

cypress bot commented Jan 9, 2026

Geotrek-admin    Run #15317

Run Properties:  status check passed Passed #15317  •  git commit 057a7561d7 ℹ️: Merge 39fb2722d28e73593d6b049f65b2c141ca2b1fe2 into d6bb701c1bdf107c8ac86e393823...
Project Geotrek-admin
Branch Review refs/pull/5202/merge
Run status status check passed Passed #15317
Run duration 02m 03s
Commit git commit 057a7561d7 ℹ️: Merge 39fb2722d28e73593d6b049f65b2c141ca2b1fe2 into d6bb701c1bdf107c8ac86e393823...
Committer Marc-Antoine Dupré
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 22
View all changes introduced in this branch ↗︎

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

Successfully merging this pull request may close these issues.

1 participant