Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Updated at" timestamp not updated during atomic update #949

Closed
m0rt3nlund opened this issue Mar 25, 2024 · 1 comment
Closed

"Updated at" timestamp not updated during atomic update #949

m0rt3nlund opened this issue Mar 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@m0rt3nlund
Copy link
Contributor

Describe the bug
The "Updated at" timestamp seems to not get updated during atomic update

To Reproduce

defmodule Shared.Ash.Support.CRM.Agent do
  use Ash.Resource,
    data_layer: AshPostgres.DataLayer

  attributes do
    uuid_primary_key :id do
      generated? true
      default nil
    end

    attribute :status, :string do
      default "idle"
    end

    update_timestamp :updated_at
    create_timestamp :inserted_at
  end
end

Shared.Ash.Support.CRM.Agent
|> Shared.Ash.Support.read_one!()
|> Ash.Changeset.for_update(:update, %{status: status})
|> Shared.Ash.Support.update()

Expected behavior
Expect the updated_at timestamp to update

Runtime

  • Elixir version: 1.16
  • Erlang version: OTP 26
  • OS: Windows
  • Ash version: 2.20.2
  • any related extension versions
@m0rt3nlund m0rt3nlund added bug Something isn't working needs review labels Mar 25, 2024
@zachdaniel
Copy link
Contributor

Fixed in latest main (and back ported to 2.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants