Skip to content

Fix mutating SQL assertion in Tool Store download#607

Closed
brendanx67 wants to merge 16 commits intorelease25.11-SNAPSHOTfrom
25.11_fb_toolstore-fix-mutating-sql
Closed

Fix mutating SQL assertion in Tool Store download#607
brendanx67 wants to merge 16 commits intorelease25.11-SNAPSHOTfrom
25.11_fb_toolstore-fix-mutating-sql

Conversation

@brendanx67
Copy link
Collaborator

Summary

  • Wrapped recordToolDownload() in SpringActionController.ignoreSqlUpdates() in DownloadToolAction
  • The download counter increment is an incidental write on a GET action (like audit logging)
  • Fixes IllegalStateException: MUTATING SQL executed as part of handling action: GET in dev mode

Context

This has always been technically incorrect (mutating SQL on GET), but only throws in dev mode with assertions enabled. LabKey platform's StatementWrapper checks isDevMode() && isMutatingSql() and throws. Production skyline.ms is unaffected since it runs in production mode. The ignoreSqlUpdates() pattern is the same one LabKey uses for audit logging on read-only actions.

Test plan

  • Verified download works on local dev server (previously returned 500)
  • Verified download counter still increments

Co-Authored-By: Claude noreply@anthropic.com

@github-actions
Copy link

ERROR: A pull request from 25.11_fb_toolstore-fix-mutating-sql is expected to target release25.11-SNAPSHOT, not develop

Copy link
Collaborator

@vagisha vagisha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please target release25.11-SNAPSHOT for this PR?

@brendanx67 brendanx67 changed the base branch from develop to release25.11-SNAPSHOT March 12, 2026 02:02
@labkey-jeckels
Copy link
Contributor

This looks like a feature branch based on develop that's being merged to 25.11. It's bringing in a bunch of other changes that can't be backported due to their dependencies on changes in other repos on the develop branch. You'll need to either rebase this branch on release25.11-SNAPSHOT or create a new 25.11 branch and cherry pick your commit.

Copy link
Collaborator

@vagisha vagisha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like your branch may have been created from develop. I think you have to rebase it onto release25.11-SNAPSHOT so the PR only includes your changes. Or create a new branch from release25.11-SNAPSHOT and cherry-pick just your commits onto it.

@brendanx67
Copy link
Collaborator Author

Closing in favor of a new PR properly based on release25.11-SNAPSHOT.

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.

7 participants