Skip to content

Fix 12 bugs found in full-source audit of main#140

Merged
vsdudakov merged 2 commits into
mainfrom
fix/audit-bugs-main
Jul 7, 2026
Merged

Fix 12 bugs found in full-source audit of main#140
vsdudakov merged 2 commits into
mainfrom
fix/audit-bugs-main

Conversation

@vsdudakov

Copy link
Copy Markdown
Owner

Full-source bug audit of the main branch across the Python backend (models, service, ORM adapters, framework integrations) and the React/TS frontend. 12 confirmed bugs, each fixed with tests where applicable.

High severity

  • Pony search crashes for non-id primary keysponyorm.py hardcoded .id; now uses get_model_pk_name, so search no longer 500s for models with a custom PK.
  • JSON field with a date key breaks form savetransform.tsx detected dayjs via truthy value.date; now uses dayjs.isDayjs(), so a plain object no longer throws on submit.
  • CheckboxGroup selections never render — antd Checkbox.Group is controlled via value, not checked; removed it from the valuePropName="checked" list.

Medium severity

  • SQLAlchemy m2m filter → 500 — relationship fields now match via .any()/.has() on the related pk instead of a scalar comparison that raised InvalidRequestError.
  • Pony mixed asc/desc ordering — Pony prepends each order_by() call, inverting priority; now built in a single call preserving declared order.
  • Flask returned 500s as HTTP 200 and leaked exception text — now returns a real 500 with a generic, logged message.
  • Flask 4xx errors were HTML, not JSON — centralized handler now returns {"detail": ...} matching the Django/FastAPI integrations, so the shared frontend can read the message.
  • Text fields that look like dates got corruptedtransformValueFromServer coerced by shape alone; now widget-aware (only date widgets parse to dayjs), threaded through change/inline/async-select.
  • Dashboard action errors silently swallowed — run/refresh handlers now catch and surface errors.

Low severity

  • Empty sortable_by docstring — corrected the self-contradictory documentation to match code behavior.
  • Filter values "true"/"false"/"null" coerced for all field typessanitize_filter_value is now type-aware so text fields keep the literal strings; added a shared build_query_filters helper.
  • invalidateQueries over-invalidated — updated to the react-query v5 { queryKey } signature.

Validation

  • Python: full suite + new tests pass; ruff and ty clean.
  • Frontend: full suite passes; tsc, biome, and eslint clean.

vsdudakov added 2 commits July 7, 2026 10:33
Backend (Python):
- ponyorm: use get_model_pk_name in search instead of hardcoded `id`
  (search 500'd for models with a non-`id` primary key)
- ponyorm: build ordering in a single order_by() call so mixed asc/desc
  fields keep their declared priority (Pony prepends per-call)
- sqlalchemy: filter m2m/relationship fields via any()/has() on the related
  pk instead of a scalar comparison that raised InvalidRequestError (500)
- flask: return a real HTTP 500 with a generic message (was HTTP 200 leaking
  the exception text), and emit API errors as JSON {"detail": ...} matching
  the Django/FastAPI integrations instead of werkzeug HTML pages
- api: make sanitize_filter_value type-aware so text fields keep the literal
  "true"/"false"/"null" strings; add shared build_query_filters helper
- base: correct the self-contradictory sortable_by docstring

Frontend (React/TS):
- transform: detect dayjs with dayjs.isDayjs() instead of truthy `value.date`
  (a plain object with a `date` key crashed form submission)
- transform: parse date/time strings to dayjs only for date widgets, threaded
  through change/inline/async-select so text fields are no longer corrupted
- form-container: Checkbox.Group binds via `value`, not `checked`
- dashboard-action-widget: handle errors on run/refresh actions
- change/add: use the react-query v5 invalidateQueries({ queryKey }) signature

Adds unit tests for the type-aware filter value, build_query_filters, the
widget-aware transforms, and the updated invalidateQueries calls.
Covers the new m2m/to-one relationship filter branch in orm_get_list
(any() for collections with exact/in, has() for to-one relations).
@vsdudakov vsdudakov merged commit 3aaec53 into main Jul 7, 2026
12 checks passed
@vsdudakov vsdudakov deleted the fix/audit-bugs-main branch July 7, 2026 07:34
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.

1 participant