Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Update requeueing condition to avoid no method error#415

Merged
vasconsaurus merged 1 commit into
developfrom
bug-undefined-method-deprecated-for-NilClass
Oct 24, 2025
Merged

Update requeueing condition to avoid no method error#415
vasconsaurus merged 1 commit into
developfrom
bug-undefined-method-deprecated-for-NilClass

Conversation

@vasconsaurus

@vasconsaurus vasconsaurus commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Description

ClaimReviewParser.parsers already returns only enabled parsers:

  def self.parsers
    QuietHashie[
      Hash[ClaimReviewParser.enabled_subclasses.map do |sc|
        [sc.service, sc]
      end]
    ]
  end

So when we try the following with a deprecated service, it returns nil.

!ClaimReviewParser.parsers[service].deprecated

Which causes:

"\"error_message\":\"undefined method `deprecated' for nil:NilClass\",
\"error_class\":\"NoMethodError\",\"failed_at\":1761238248.0907707,
\"retry_count\":6,\"retried_at\":1761239681.7711115}"}"

Reference: CV2-6609

ClaimReviewParser.parsers already returns only enabled parsers:

  def self.parsers
    QuietHashie[
      Hash[ClaimReviewParser.enabled_subclasses.map do |sc|
        [sc.service, sc]
      end]
    ]
  end

ClaimReviewParser.parsers
=> #<QuietHashie reuters_brazil=ReutersBrazil reuters_spanish=ReutersSpanish>

irb(main):003:0> ClaimReviewParser.parsers['aos_fatos']
=> nil

This causes
"\"error_message\":\"undefined method `deprecated' for nil:NilClass\",
\"error_class\":\"NoMethodError\",\"failed_at\":1761238248.0907707,
\"retry_count\":6,\"retried_at\":1761239681.7711115}"}"
@vasconsaurus

Copy link
Copy Markdown
Contributor Author

@caiosba I think this might actually solve our issues, as it should stop re-queueing deprecated classes. But, should we add something to more explicitly kill jobs instead of just not re-queueing, or should this be enough?

@caiosba caiosba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vasconsaurus let's try to see if it clears the queue naturally, if it doesn't, we can manually clear them.

@vasconsaurus vasconsaurus merged commit 02eaec9 into develop Oct 24, 2025
5 checks passed
@vasconsaurus vasconsaurus deleted the bug-undefined-method-deprecated-for-NilClass branch October 24, 2025 15:40
vasconsaurus added a commit that referenced this pull request Oct 24, 2025
ClaimReviewParser.parsers already returns only enabled parsers. So when we try `!ClaimReviewParser.parsers[service].deprecated` with a deprecated service, it returns nil.

Which causes:
"\"error_message\":\"undefined method `deprecated' for nil:NilClass\",
\"error_class\":\"NoMethodError\",\"failed_at\":1761238248.0907707,
\"retry_count\":6,\"retried_at\":1761239681.7711115}"}"
@vasconsaurus vasconsaurus changed the title Update condition Update requeueing condition to avoid no method error Oct 24, 2025
@vasconsaurus vasconsaurus mentioned this pull request Oct 24, 2025
8 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants