Skip to content

Conversation

npezza93
Copy link
Contributor

@npezza93 npezza93 commented Sep 4, 2025

Reimplementing ActiveRecord::Coders::JSON is definitely not my favorite fix so im open to any ideas on how to clean this up.

But if you set ActiveSupport.parse_json_times = true an error gets thrown when running jobs because of this line in active_job/core.rb:170:

      self.enqueued_at          = Time.iso8601(job_data["enqueued_at"]) if job_data["enqueued_at"]

When parse_json_times is enabled job_data["enqueued_at"] is an AS::TimeWithZone object instead of a string.
Alternatively, I could send a patch to Rails to force it to be a string: Time.iso8601(job_data["enqueued_at"].to_s) but thought I would start here and get thoughts since that fix could impact all ActiveJob adapters.

@npezza93 npezza93 force-pushed the date-parsing branch 3 times, most recently from 5f633a1 to 5aa8398 Compare September 4, 2025 00:20
@npezza93 npezza93 changed the title Correctly handle jobs when ActiveSupport.parse_json_times is enabled Handle jobs when ActiveSupport.parse_json_times is enabled Sep 4, 2025
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