AshPaperTrail

[warning] Unhandled error in form submission for AshTableVue.GoldenDataset.Resources.Question.update

This error was unhandled because Ash.Error.Framework.MustBeAtomic does not implement the `AshPhoenix.FormData.Error` protocol.

** (Ash.Error.Framework.MustBeAtomic) AshTableVue.GoldenDataset.Resources.Question.update must be performed atomically, but it could not be

Reason: Cannot perform full_diff change tracking with AshPaperTrail atomically. You might want to choose a different tracking mode or set require_atomic? to false on your update actions.

See https://hexdocs.pm/ash/update-actions.html#fully-atomic-updates for more on atomics.
[warning] Unhandled error in form submission for AshTableVue.GoldenDataset.Resources.Question.update

This error was unhandled because Ash.Error.Framework.MustBeAtomic does not implement the `AshPhoenix.FormData.Error` protocol.

** (Ash.Error.Framework.MustBeAtomic) AshTableVue.GoldenDataset.Resources.Question.update must be performed atomically, but it could not be

Reason: Cannot perform full_diff change tracking with AshPaperTrail atomically. You might want to choose a different tracking mode or set require_atomic? to false on your update actions.

See https://hexdocs.pm/ash/update-actions.html#fully-atomic-updates for more on atomics.
I am trying to update an ash resource which has ash_paper_trail enabled on it. but i get this error. Don't fully understand this yet
2 Replies
ZachDaniel
ZachDaniel5mo ago
If you are doing full diff tracking, it requires us to know the "old state" and the "new state" alongside eachother this is not something that can be done in a single atomic data layer operation If you use a different change tracking mode like "changes only" then you can do atomic updates otherwise you have to add require_atomic? false to support it, and be aware that those actions are not encessarily safe to run in parallel. Specifically, two actions might happen, they might read the same "old state", and then create two new versions indicating a change from that old state to the new
abeeshake456
abeeshake456OP5mo ago
# default is :snapshot
change_tracking_mode :full_diff
# default is :snapshot
change_tracking_mode :full_diff
if I change now to change_only mode, will that need db migration ?

Did you find this page helpful?