Skip to content

Conversation

@bbbriana
Copy link

@bbbriana bbbriana commented Jan 28, 2026

https://github.com/shop/issues/issues/1596

If there are no records, we cannot take any action so discard the job:

The job cannot function without the record:                                                                                                                                                                      
                                                                                                                                                                                                                   
  The RecordNotFound is raised during GlobalID deserialization, before perform is even called. But even if it weren't, look at what execute does immediately:                                                      
                                                                                                                                                                                                                   
  def execute                                                                                                                                                                                                      
    @commands = Commands.for(@task)      # needs task                                                                                                                                                              
    unless @task.pending?                 # needs task                                                                                                                                                             
      Rails.logger.error("Task ##{@task.id}...")  # needs task                                                                                                                                                     
      return                                                                                                                                                                                                       
    end                                                                                                                                                                                                            
    run                                                                                                                                                                                                            
                                                                                                                                                                                                                   
  And run calls:                                                                                                                                                                                                   
  - @task.ping                                                                                                                                                                                                     
  - @task.run!                                                                                                                                                                                                     
  - @task.write(...)                                                                                                                                                                                               
  - @task.report_complete!                                                                                                                                                                                         
  - etc.                                                                                                                                                                                                           
                                                                                                                                                                                                                   
  Every single operation requires the task record. Without it:                                                                                                                                                     
  - No commands can be built                                                                                                                                                                                       
  - No status can be checked                                                                                                                                                                                       
  - No output can be written                                                                                                                                                                                       
  - No completion can be reported        

@bbbriana bbbriana requested a review from a team January 28, 2026 01:11
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