• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MushroomObserver / mushroom-observer / 28882362678

07 Jul 2026 04:32PM UTC coverage: 99.048% (-0.06%) from 99.103%
28882362678

Pull #4719

github

JoeCohen
Fix handling of licensed param in URL

- Fixes superimporter "import others" confirm counts and unlicensed-obs handling

The confirm page miscounted Requested/Expected/Already-imported when a superimporter's URL filtered on `licensed=false`, and unlicensed observations were misclassified as "already imported" instead of their own category.

- `URLNormalizer` no longer strips `licensed` from the URL, so estimates reflect the user's actual request.
- `Estimators` adds `not_yet_imported`/`licensed_explicitly_false?` so Expected/Total Ignored short-circuit correctly instead of querying an unrelated population.
- `PageParser#add_ownership_filter` now defaults `licensed:true` instead of always overriding it.
- `ObservationImporter#unlicensed_other?` is the real safety net: for import-others, an obs with no iNat license is skipped entirely (new `ignored_unlicensed_count`), while individual unlicensed photos on an otherwise-licensed obs are still skipped per-image as before.
- Confirm page moves the unlicensed count into the Ignored Observations breakdown for import-others.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Pull Request #4719: Fix handling of licensed param in URL

42 of 42 new or added lines in 8 files covered. (100.0%)

29 existing lines in 11 files now uncovered.

51710 of 52207 relevant lines covered (99.05%)

754.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/app/classes/api2/error/object_error.rb
1
# frozen_string_literal: true
2

3
class API2
4✔
4
  # API exception base class for errors having to do with database records.
5
  class ObjectError < FatalError
4✔
6
    def initialize(obj)
4✔
7
      super()
53✔
8
      args.merge!(type: obj.type_tag, name: display_name(obj))
53✔
9
    end
10

11
    def display_name(obj)
4✔
12
      if obj.respond_to?(:unique_text_name)
53✔
13
        obj.unique_text_name
31✔
14
      elsif obj.respond_to?(:display_name)
22✔
15
        obj.display_name
×
16
      elsif obj.respond_to?(:name)
22✔
17
        obj.name
5✔
18
      elsif obj.respond_to?(:title)
17✔
UNCOV
19
        obj.title
×
20
      else
21
        "##{obj.id}"
17✔
22
      end
23
    end
24
  end
25
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc