Upgrade from 3.5.12 to 3.7.6 Broke Calculcation
I'm getting this strange error suddenly:
I have a calcluation that dispalyed a rate and price with currency like here;
And this seems to be breaking when I load the calcluation.
16 Replies
where does
client come into things? what resource is this?thanks, i suppose i need to layout my diagram:
TimeEntry -> belongs to Service, Project, User
attributes: rate, hours
Project -> Belongs to Client
I'm showing all time entries with the rate and total across all projects for all users:
So i would believe that the time entry -> project -> client ##> currency
As each client has a different currency
Will need a repro for this one. We fixed the way that nested calculation exists work, and must have had an unintended consequence
We need whatever you're doing as a test case 😅
sure
should i just make a reproduction repo? can work on that, today, as i'd like to update this project to add more features 😄
It's up to you. I make no guarantees as to when I will look at it, but can only offer the fact that if you make a PR with a test failure I will be significantly more likely to look into it
**sooner
Yeah. I will do that today. Fastest is I just reproduce my issue in a separate repo
after looking further, it seems to be this:
* ** (MatchError) no match of right hand side value: {:error, "Invalid reference project.client.project.currency"}
changing to calculation seems to work:
🤔 very strange
indeed. it works after changing to calculation 😄
I think it's affected me also 🤣 , that silly policy I have is now failing (policy checking relates_to_actor_via a no_attributes has_many relationship which references a calculation which references a list aggregate) (the ST_Union() etc etc)
@allenwyma I fixed something related to this in Ash core that may have helped here? not sure.
It fixed something WRT nested calculations accessed on relationships, so its at least tangentially related
thanks! you want me to revert and try? i just changed to the above style to fix it since it's basically the same
If you could yes. Also is there a big open for the issue right now?
If not, and it's still broken, please open one
i need to check this still, but haven't had a moment. sorry
I am also experiencing breakage with calculations, specifically with these versions (they all get upgraded together):
I think it's because I'm combining
expr with load in the calculate definition, as this PR would indicate.
Hmmm. There's still something wrong; the symptom I'm seeing is that Cinder is not loading my calculations when Ash >= 3.7.0
I'm narrowing it down to loading calculations + aggregates together
This issue is harder to nail down than I thought it would be. Claude has failed me for creating an isolated test case.Oh, man. I just spent hours reproducing this only to discover that there's already an issue for it on ash_sql: https://github.com/ash-project/ash_sql/issues/190
GitHub
Ecto.QueryError: when loading aggregates in the query with Ash.Quer...
Code of Conduct I agree to follow this project's Code of Conduct AI Policy I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue. Versions El...
I found another bug, so it wasn't a total waste of time: https://github.com/ash-project/ash_sql/issues/191
GitHub
Calculations fail to load when loading aggregate · Issue #191 · a...
Code of Conduct I agree to follow this project's Code of Conduct AI Policy I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue. Versions as...