Commit e240757
authored
fix: harden BaserowIndex evaluation against unaugmented args (baserow#5321)
`BaserowIndex.to_django_expression_given_args` assumed that
`type_function_given_valid_args` had already augmented every call from 2
to 4 arguments by appending the array sub-type's mode and SQL template
literals. When the augmentation has not run, accessing args[2]/args[3]
raises `IndexError: list index out of range` and breaks endpoints that
evaluate the formula (row create/update/delete, batch operations, and
application-builder dispatch).
Fall back to the generic text extraction defaults when fewer than four
arguments are present so the function degrades gracefully instead of
500ing.
Fixes baserow#5320 / Sentry BASEROW-SAAS-BACKEND-GT1 parent e087e71 commit e240757
3 files changed
Lines changed: 39 additions & 2 deletions
File tree
- backend
- src/baserow/contrib/database/formula/ast
- tests/baserow/contrib/database/formula
- changelog/entries/unreleased/bug
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3107 | 3107 | | |
3108 | 3108 | | |
3109 | 3109 | | |
3110 | | - | |
3111 | | - | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
3112 | 3116 | | |
3113 | 3117 | | |
3114 | 3118 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments